Skip to content

fix: sync every storage var that shares a name across tabs - #7545

Merged
FarhanAliRaza merged 2 commits into
reflex-dev:mainfrom
flcrom:fix-storage-sync-shared-name
Oct 15, 2026
Merged

FarhanAliRaza merged 2 commits into
reflex-dev:mainfrom
flcrom:fix-storage-sync-shared-name

Conversation

@flcrom

@flcrom flcrom commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Closes #7506.

Builds on #7544. The first commit in this branch is that PR's commit (9870bf1), because the new test uses the react override that #7544 adds to the state_js.test.mjs setup. Only the second commit (40bfe59) is new here. I'll rebase onto main once #7544 merges, or happy to restructure if you prefer.

When several sync=True storage vars share one storage name, a write in another tab updated only one of them (the last declared), so the others stayed stale until a reload. The common case is a named synced field on an rx.ComponentState used more than once. The cross-tab sync now updates every var that shares the name.

Added tests to state_js.test.mjs for the shared-name case. node --experimental-vm-modules --test tests/units/compiler/state_js.test.mjs passes locally, 21/21. I did not run the full test suite or lint locally; CI will.

News fragment included.

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

  • Bug fix (non-breaking change which fixes an issue)

View guided diff

@flcrom
flcrom requested a review from a team as a code owner October 11, 2026 05:02

@cubic-dev-ai cubic-dev-ai Bot left a comment

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.

No issues found across 4 files

View guided diff | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues were found.

Summary

Cross-tab storage updates now sync every sync=True variable that shares a storage name.

  • A storage change updates every synced variable that shares its name.

Reviews (4) · Last reviewed commit: "Merge branch 'main' into fix-storage-syn..." · Reviewed by Greptile

@codspeed

codspeed Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 9 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

✅ 148 untouched benchmarks


Comparing flcrom:fix-storage-sync-shared-name (cadf7a6) with main (2fc4a9c)

Open in CodSpeed

@flcrom
flcrom force-pushed the fix-storage-sync-shared-name branch from 40bfe59 to 21bc00e Compare October 11, 2026 05:28
@masenf masenf added the on deck PRs lined up to review / merge next label Oct 13, 2026

@masenf masenf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

looks good. rebase on main now that your other PR has merged

@flcrom
flcrom force-pushed the fix-storage-sync-shared-name branch from 21bc00e to f88486b Compare October 14, 2026 08:28
@flcrom

flcrom commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main (f88486b).

@masenf masenf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

appreciate it

@FarhanAliRaza
FarhanAliRaza merged commit f10cff4 into reflex-dev:main Oct 15, 2026
146 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

on deck PRs lined up to review / merge next

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Several sync=True storage vars sharing one name only sync the last one across tabs

3 participants