Skip to content

fix(emails/soup): fix live updating in email block and in soup#522

Merged
synoet merged 5 commits intomainfrom
synoet/m-5369-emails-in-block-email-and-in-soup-dont-live-update
Dec 9, 2025
Merged

fix(emails/soup): fix live updating in email block and in soup#522
synoet merged 5 commits intomainfrom
synoet/m-5369-emails-in-block-email-and-in-soup-dont-live-update

Conversation

@synoet
Copy link
Copy Markdown
Contributor

@synoet synoet commented Dec 9, 2025

This pr's fixes live updating for emails in both the unified list and in email-block.

Two issues where causing this:

  • The notification source effect was wrong, it runs on old notifications that get fetched, not just just new ones.
  • The email notification type mapping was incorrect.

I'm not quite happy with the current invalidation pattern, as we continue to build out our own sync-engine we can establish some better patterns.

Ideally we define an interface that represents incoming invalidations, and we pass it to the query client provider. The query client provider mounts a single effects that handles
incoming invalidation messages and maps them to the correct resource and does some smarter reconciliation.

@linear
Copy link
Copy Markdown

linear bot commented Dec 9, 2025

@synoet synoet requested a review from aquaductape December 9, 2025 20:40
@synoet synoet marked this pull request as ready for review December 9, 2025 20:43
@synoet synoet requested a review from a team as a code owner December 9, 2025 20:43
@synoet synoet requested a review from dev-rb December 9, 2025 20:43
Copy link
Copy Markdown
Contributor

@dev-rb dev-rb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nit but lgtm

callback(newNotifications);
}
createEffect(() => {
let cleanup: (() => void) | undefined;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: just inline this const cleanup = notificationSource.subscribe....

@synoet synoet merged commit c43bcd0 into main Dec 9, 2025
18 checks passed
@synoet synoet deleted the synoet/m-5369-emails-in-block-email-and-in-soup-dont-live-update branch December 9, 2025 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants