Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete multiple notifications quickly makes them come back #1046

Closed
PVince81 opened this issue Jul 13, 2021 · 2 comments
Closed

Delete multiple notifications quickly makes them come back #1046

PVince81 opened this issue Jul 13, 2021 · 2 comments

Comments

@PVince81
Copy link
Member

Steps to reproduce

  1. Have 10+ notifications, ideally spaced with a few minutes to make them easier to recognize (or different contents)
  2. Have a slow instance
  3. Open the bell icon dropdown
  4. Quickly click on the delete icon of the top notification, then for the next one as it appears on top, etc

Expected result

All notifications gone

Actual

Notifications pop up again.
The network console did show a 200 OK for the DELETE operations.
If I refresh the page, the notifications are gone.

Versions

Observed on NC 22 on c.nc.com with notifications that came from people answering to a poll from the forms app.

Analysis

I suspect that the frontend code is not properly handling multiple deletions in parallel, and the refresh code might mistakenly reuse an old version of the collection.

@nickvergessen
Copy link
Member

nickvergessen commented Jul 16, 2021

Can't reproduce, I think it could be caused by the notify_push we run on c.nc.c together with our slow server.
What I think happens is the following:

  1. You delete a notification
  2. notify_push sends a notify to the frontend
  3. notifications app triggers a fetch:

    notifications/src/App.vue

    Lines 156 to 158 in 2287957

    const hasPush = listen('notify_notification', () => {
    this._fetch()
    })
  4. The server starts response of the fetch
  5. You delete another notification (and it's immediately hidden in the UI)
  6. The server finishes sending the notification with the notification you deleted in 5.
  7. The UI adds the notification again as it is in the list of your notifications

But seeing those steps, it could also happen when you happen to delete exactly when the 30s sync of notification happens without the notify_push (it's just very much more unlikely).

What we could do is keep a record of successful deletes and filter them out manually on the results, but it sounds rather messy.

@nickvergessen
Copy link
Member

Should be fixed with #1153

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants