ExportXMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Normal
    • None
    • Component/s: None
    • None

      On the feed page, users can thank other users they follow for recommendation, reviews, pins, etc.

      Currently, thanking a users for a pin event will result in a bug caused by using the wrong ID.
      A request is made to fetch the original feed event, but this uses the pin ID instead of the feed event ID, and causes another bug as a consequence.
      See screenshot for an example

      Trying to load the timeline event with this ID will return an unrelated notification event (year in music available notification). The server then tries to fetch metadata for said event which is not a track-based event, and this causes a 500 error:

        File "/code/listenbrainz/listenbrainz/webserver/views/user_timeline_event_api.py", line 327, in user_feed_event
          _ = fetch_track_metadata_for_items(ts_conn, [user_event.metadata])
        File "/code/listenbrainz/listenbrainz/db/msid_mbid_mapping.py", line 57, in fetch_track_metadata_for_items
          if item.recording_mbid:
             ^^^^^^^^^^^^^^^^^^^
      AttributeError: 'NotificationMetadata' object has no attribute 'recording_mbid'
      

      Se here where we set the id of the pin event as pin.row_id
      https://github.com/metabrainz/listenbrainz-server/blob/30d1823d90c8b341a7fa5cd199af2496b43e984e/listenbrainz/webserver/views/user_timeline_event_api.py#L1169-L1170
      This is the id that will be stored with the thanks_event metadata and be used later on to load the original event, erroneously using a pin id instead of an event id

      I do notice that the event_type "recording_pin" does not exist in user_timeline_event_type_enum at the time of writing this ticket, but does exist in the UserTimelineEventType class, as well as there being a APIPinEvent class.

            Assignee:
            Parv Mittal
            Reporter:
            Monkey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package