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

Merged
FL
2d ago
+95-11

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)