gotosocial icon indicating copy to clipboard operation
gotosocial copied to clipboard

[bug] Duplicate boost notifications

Open benjaminbhollon opened this issue 10 months ago • 6 comments

Describe the bug with a clear and concise description of what the bug is.

Fairly often lately, I've received duplicate poll notifications. Usually only two notifications total, but just now I received ten identical boost notifications from the same user at the same time for this post: https://alpha.polymaths.social/@amin/statuses/01HW1Z0MMSCT07Q7V9ADZQXPX4

They remain when I close my client and reload the notifications list and across multiple clients.

What's your GoToSocial Version?

v0.15.0

GoToSocial Arch

amd64 Binary

What happened?

No response

What you expected to happen?

I expect only to receive one notification per boost.

How to reproduce it?

No response

Anything else we need to know?

If it helps at all, I think I've only seen this problem with boosts from remote instances.

benjaminbhollon avatar Apr 22 '24 04:04 benjaminbhollon

I've seen it too and think I know the cause! It's to do with multiple people from your instance receiving the boost, and the notif creation not being debounced, I think.

tsmethurst avatar Apr 22 '24 06:04 tsmethurst

How does that work? I'm having trouble imagining multiple people "receiving" a boost…

Oh, like in their home timeline?

benjaminbhollon avatar Apr 22 '24 14:04 benjaminbhollon

Say 5 people on your instance follows the same person, and that person boosts the status of one of you. 5 people on your instance receive the Announce Activity in their inbox. Normally GoToSocial deduplicates side effects to make sure they're only performed once (in this case, creating a notification and storing the boost in the database). But I think it's possible that those side effects aren't being deduplicated properly in this case, hence the multiple notifications. But that's just my hunch, I have to actually investigate.

tsmethurst avatar Apr 22 '24 17:04 tsmethurst

Okay, yeah, that makes sense.

benjaminbhollon avatar Apr 23 '24 03:04 benjaminbhollon

Had it happen again with a boost from the same user, but this time with only three notifications, which is interesting data.

benjaminbhollon avatar Apr 23 '24 15:04 benjaminbhollon

Well it's a race condition I believe, so it makes sense that the results will differ.

tsmethurst avatar Apr 23 '24 15:04 tsmethurst