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

fix 1695 by not updating ancestors on zap #1766

Merged
merged 2 commits into from
Dec 27, 2024
Merged

fix 1695 by not updating ancestors on zap #1766

merged 2 commits into from
Dec 27, 2024

Conversation

huumn
Copy link
Member

@huumn huumn commented Dec 27, 2024

I'm running out of less severe changes to fix this bug. I describe the problem in #1695 some, but the gist is:

  1. a thread is cached on the client
  2. someone replies to us in that thread and we get a notification
  3. we zap the item in notifications and the optimistic response updates all of an item's ancestors in the cache
  4. on navigation, we use writeQuery to merge SSR data with the cache
  5. writeQuery does not support merging into optimistic caches, so until the real response returns, the stale optimistic cache (which does not yet have the item in the thread) is shown

(I should note this happens in more places than just notifications, so doing a hack checking the pathname is especially not worth it.)

This fixes the problem by avoiding a need to merge the ancestors in the thread. BUT it means the commentSats which displays at the top of comment threads never updates in response to zaps. The tradeoff is worth it, but I'd prefer to not have to make it.

I'll try a few more fixes, but there aren't many things left to try.

I wound up updating ancestors onPaid ... we still can update commentSats (with some delay) and this write conflict doesn't happen.

@huumn huumn merged commit 18445b1 into master Dec 27, 2024
6 checks passed
@huumn huumn deleted the fix-1695 branch December 27, 2024 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant