Skip to content

fix(store): return original reference from updateItems when no elements match#2424

Merged
arturovt merged 1 commit into
masterfrom
fix/update-items
Mar 31, 2026
Merged

fix(store): return original reference from updateItems when no elements match#2424
arturovt merged 1 commit into
masterfrom
fix/update-items

Conversation

@arturovt
Copy link
Copy Markdown
Member

updateItems always returned a new array clone, even when no element matched the predicate. This caused memoized selectors to see a changed reference and re-evaluate on every no-op call.

Track whether any element was actually updated and return the original array reference unchanged when the predicate matched nothing.

…ts match

updateItems always returned a new array clone, even when no element
matched the predicate. This caused memoized selectors to see a changed
reference and re-evaluate on every no-op call.

Track whether any element was actually updated and return the original
array reference unchanged when the predicate matched nothing.
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Mar 31, 2026

🤖 Nx Cloud AI Fix Eligible

An automatically generated fix could have helped fix failing tasks for this run, but Self-healing CI is disabled for this workspace. Visit workspace settings to enable it and get automatic fixes in future runs.

To disable these notifications, a workspace admin can disable them in workspace settings.


View your CI Pipeline Execution ↗ for commit bdcf5d7

Command Status Duration Result
nx run-many --target=test --all --configuration... ❌ Failed 1m 20s View ↗
nx run-many --target=lint --all --configuration... ✅ Succeeded 5s View ↗
nx lint-types store ✅ Succeeded 3s View ↗
nx run-many --target=build --all ✅ Succeeded 2s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-31 17:32:13 UTC

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Mar 31, 2026

Open in StackBlitz

@ngxs/devtools-plugin

npm i https://pkg.pr.new/@ngxs/devtools-plugin@2424

@ngxs/form-plugin

npm i https://pkg.pr.new/@ngxs/form-plugin@2424

@ngxs/hmr-plugin

npm i https://pkg.pr.new/@ngxs/hmr-plugin@2424

@ngxs/router-plugin

npm i https://pkg.pr.new/@ngxs/router-plugin@2424

@ngxs/storage-plugin

npm i https://pkg.pr.new/@ngxs/storage-plugin@2424

@ngxs/store

npm i https://pkg.pr.new/@ngxs/store@2424

@ngxs/websocket-plugin

npm i https://pkg.pr.new/@ngxs/websocket-plugin@2424

commit: bdcf5d7

@arturovt arturovt marked this pull request as ready for review March 31, 2026 17:29
@arturovt arturovt merged commit 44d0a69 into master Mar 31, 2026
8 of 10 checks passed
@arturovt arturovt deleted the fix/update-items branch March 31, 2026 17:29
@bundlemon
Copy link
Copy Markdown

bundlemon Bot commented Mar 31, 2026

BundleMon

Files updated (1)
Status Path Size Limits
fesm2022/ngxs-store-operators.mjs
15.74KB (+217B +1.36%) 16KB / +0.5%
Unchanged files (5)
Status Path Size Limits
fesm2022/ngxs-store.mjs
111.92KB 114KB / +0.5%
fesm2022/ngxs-store-internals.mjs
13.74KB 15KB / +0.5%
fesm2022/ngxs-store-internals-testing.mjs
10.32KB 13KB / +0.5%
fesm2022/ngxs-store-plugins.mjs
2.37KB 3KB / +0.5%
fesm2022/ngxs-store-experimental.mjs
574B 2KB / +0.5%

Total files change +217B +0.14%

Groups updated (1)
Status Path Size Limits
@ngxs/store(fesm2022)[gzip]
./fesm2022/*.mjs
38.33KB (+30B +0.08%) +1%

Final result: ❌

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@bundlemon
Copy link
Copy Markdown

bundlemon Bot commented Mar 31, 2026

BundleMon (NGXS Plugins)

Unchanged files (9)
Status Path Size Limits
Plugins(fesm2022)[gzip]
storage-plugin/fesm2022/ngxs-storage-plugin.m
js
4.12KB +0.5%
Plugins(fesm2022)[gzip]
router-plugin/fesm2022/ngxs-router-plugin.mjs
3.4KB +0.5%
Plugins(fesm2022)[gzip]
hmr-plugin/fesm2022/ngxs-hmr-plugin.mjs
2.72KB +0.5%
Plugins(fesm2022)[gzip]
websocket-plugin/fesm2022/ngxs-websocket-plug
in.mjs
2.58KB +0.5%
Plugins(fesm2022)[gzip]
form-plugin/fesm2022/ngxs-form-plugin.mjs
2.47KB +0.5%
Plugins(fesm2022)[gzip]
devtools-plugin/fesm2022/ngxs-devtools-plugin
.mjs
2.23KB +0.5%
Plugins(fesm2022)[gzip]
logger-plugin/fesm2022/ngxs-logger-plugin.mjs
2.03KB +0.5%
Plugins(fesm2022)[gzip]
storage-plugin/fesm2022/ngxs-storage-plugin-i
nternals.mjs
947B +0.5%
Plugins(fesm2022)[gzip]
router-plugin/fesm2022/ngxs-router-plugin-int
ernals.mjs
453B +0.5%

No change in files bundle size

Unchanged groups (1)
Status Path Size Limits
All Plugins(fesm2022)[gzip]
./-plugin/fesm2022/.mjs
20.91KB +0.5%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@bundlemon
Copy link
Copy Markdown

bundlemon Bot commented Mar 31, 2026

BundleMon (Integration Projects)

Unchanged files (1)
Status Path Size Limits
Main bundles(Gzip)
hello-world-ng21/dist-integration/browser/mai
n-(hash).js
67.33KB +1%

No change in files bundle size

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@nineninesevenfour
Copy link
Copy Markdown

nineninesevenfour commented Apr 3, 2026

Hi! You might have a look at operators/tests/update-items.spec.ts, which seems to have started failing with this MR.

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.

2 participants