Skip to content

Fix stale mappings for primitive store arrays#2722

Open
brenelz wants to merge 3 commits into
solidjs:nextfrom
brenelz:fix-store-primitive-array-map
Open

Fix stale mappings for primitive store arrays#2722
brenelz wants to merge 3 commits into
solidjs:nextfrom
brenelz:fix-store-primitive-array-map

Conversation

@brenelz
Copy link
Copy Markdown
Contributor

@brenelz brenelz commented May 26, 2026

Fixes <For> / mapArray updates when a derived store replaces a same-length array of primitive values.

When store reconciliation updated primitive array entries, it set the per-index signals but did not mark the array as changed. As a result, $TRACK subscribers such as mapArray could keep stale row mappings when the array length stayed the same.

This marks primitive item replacements as array changes so the list mapping reruns correctly.

Added a regression test covering a derived store returning a flat string array.

Fixes #2720.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 26, 2026

🦋 Changeset detected

Latest commit: 23c9563

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@solidjs/signals Patch
test-integration Patch
solid-js Patch
babel-preset-solid Patch
@solidjs/web Patch
@solidjs/html Patch
@solidjs/h Patch
@solidjs/universal Patch
@solidjs/element Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 26, 2026

Merging this PR will not alter performance

✅ 118 untouched benchmarks


Comparing brenelz:fix-store-primitive-array-map (23c9563) with next (99d829e)

Open in CodSpeed

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.

1 participant