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 store syncing unintentionally #562

Merged
merged 6 commits into from
Nov 6, 2024
Merged

Conversation

keyserj
Copy link
Collaborator

@keyserj keyserj commented Nov 6, 2024

Closes #556

Description of changes

  • also misc changes, see commits

Additional context

could potentially use it for wiki-like topics
because notifications required a topic
previously would always sync when store changes, except when topic.id
doesn't change.

this was a problem because an SPA navigation that pulled in new changes
would treat those as a diff and try to save them again.

now, we add a flag to syncing middleware to control syncing - off when
we're pulling data from local storage or the API, on otherwise.

note: we also don't sync if we're on the playground.

note2: this logic is being duplicated across stores. didn't want to
take efforts to make code reusable, since this solution might not be
used long-term (could switch to CRDT later).
had kind of hurt to look at.

also darkened solution a little bit and
reduced component saturation to further distinguish the two
from each other.
Copy link

netlify bot commented Nov 6, 2024

Deploy Preview for velvety-vacherin-4193fb ready!

Name Link
🔨 Latest commit 417303d
🔍 Latest deploy log https://app.netlify.com/sites/velvety-vacherin-4193fb/deploys/672b8a15f546010008c5b3dd
😎 Deploy Preview https://deploy-preview-562--velvety-vacherin-4193fb.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 61
Accessibility: 86
Best Practices: 92
SEO: 92
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Nov 6, 2024

Deploy Preview for ameliorate-docs canceled.

Name Link
🔨 Latest commit 417303d
🔍 Latest deploy log https://app.netlify.com/sites/ameliorate-docs/deploys/672b8a15ea4c10000805023d

@keyserj keyserj merged commit c04ce01 into main Nov 6, 2024
13 checks passed
@keyserj keyserj deleted the fix-store-syncing-unintentionally branch November 6, 2024 15:40
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.

Loading same topic with new data tries to save data again
1 participant