Sometimes a notification cannot be dismissed #49

Closed
opened 2020-08-20 14:09:15 +00:00 by feld · 4 comments
Owner

I've run into this a few times, cannot figure out why a notification will not get dismissed.

notification

I've run into this a few times, cannot figure out why a notification will not get dismissed. ![notification](/attachments/ee823d06-a34b-445d-bd14-0d0539f3e89a)
Member

@feld Does this notification reference a direct status?

@feld Does this notification reference a `direct` status?
Member

Looks like the author has deleted that status after FE has already received and stored the corresponding notification (because of the typo I guess, since their next status is the corrected version of it). Since the notification no longer exists (BE deletes it along with the status), the FE most likely gets the 4xx error when calling POST /api/v1/pleroma/notifications/read.

E.g., steps to reproduce:

  1. mention the user while their FE is opened but the window is unfocused (so that the notification is not read automatically, as soon as it appears)
  2. wait a few seconds for the notification to be created and added to FE
  3. delete the status
  4. as the receiving user, open the notification page, FE tries to read it but gets the 400 response since it no longer exists on BE
Looks like the author has deleted that status after FE has already received and stored the corresponding notification (because of the typo I guess, since their next status is the corrected version of it). Since the notification no longer exists (BE deletes it along with the status), the FE most likely gets the 4xx error when calling `POST /api/v1/pleroma/notifications/read`. E.g., steps to reproduce: 1) mention the user while their FE is opened but the window is unfocused (so that the notification is not read automatically, as soon as it appears) 2) wait a few seconds for the notification to be created and added to FE 3) delete the status 4) as the receiving user, open the notification page, FE tries to read it but gets the 400 response since it no longer exists on BE
Member

Should the back-end handle this gracefully too?

Should the back-end handle this gracefully too?
Member

I think it sort of already does, it broadcasts the status delete event (https://docs.joinmastodon.org/methods/timelines/streaming/#websocket-a-idwebsocketa) which FE can use to remove the corresponding notification as soon as the status is deleted (before the user navigates to the notification feed and tries to mark it as read)

I think it sort of already does, it broadcasts the status delete event (https://docs.joinmastodon.org/methods/timelines/streaming/#websocket-a-idwebsocketa) which FE can use to remove the corresponding notification as soon as the status is deleted (before the user navigates to the notification feed and tries to mark it as read)
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pleroma/fedi-fe#49
No description provided.