Fix linked row caches after relationship definition changes - #303
Open
dajiaohuang wants to merge 1 commit into
Open
Fix linked row caches after relationship definition changes#303dajiaohuang wants to merge 1 commit into
dajiaohuang wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #302.
Refresh listener-backed linked-row caches when a relationship definition is recalculated. Changing either table can switch between a self-table chain and a cross-table singleton without changing any row's remote ID.
Populate existing listeners' caches before replacing table IDs so the old results remain available even after another listener cleared a shared cache. During the existing forced definition recalculation, compare refreshed results and use the existing notification set to notify affected listeners once. Ordinary store updates retain their existing path.
Adds regression cases for both transition directions, changing either table, unchanged definitions, multiple listeners, listener removal, subsequent data updates, and definition deletion. No public API, dependency, or shared-helper change.
How did you test this change?
compileForTestbuild and export parity: passed.unitproject: 4879 passed, two existing middleware synchronization failures. Both failures reproduce identically on a separately built, clean worktree at the same main commit (expectedA, receiveda). Other configured test projects are not included in this count.git diff --check: passed.gulp tswrapper subsequently failed spawningnpxon Windows; running its two declared Svelte checks directly with the installed executable passed with zero errors and warnings.Environment: Windows, Node.js v24.14.1. Development dependencies were shared with an existing checkout; test-only resolution overrides outside this PR ensured each run loaded the correct isolated build.
The first native build attempt encountered the existing docs-label race covered by #295; a retry passed without modifying build sources.