Skip to content

fix: avoid mutating caller's array via splice in snapshot sync (A-718)#21759

Open
PhilWindle wants to merge 1 commit intomerge-train/spartanfrom
phil/a-718-audit-38-snapshot-sync-mutates-source-ids-array-via-splice
Open

fix: avoid mutating caller's array via splice in snapshot sync (A-718)#21759
PhilWindle wants to merge 1 commit intomerge-train/spartanfrom
phil/a-718-audit-38-snapshot-sync-mutates-source-ids-array-via-splice

Conversation

@PhilWindle
Copy link
Collaborator

Summary

  • Replace splice(0, N) with index-based slice(i, i+N) in BrokerCircuitProverFacade to avoid mutating the caller's ids array during snapshot sync batching.

Fixes A-718

Test plan

  • Build passes
  • The fix is mechanical: replacing mutating splice(0, N) with non-mutating slice(i, i+N) in a for-loop

🤖 Generated with Claude Code

@PhilWindle PhilWindle force-pushed the phil/a-718-audit-38-snapshot-sync-mutates-source-ids-array-via-splice branch from e58872c to 186eee0 Compare March 18, 2026 18:17
Use chunk + asyncPool to replace splice-based batching in
BrokerCircuitProverFacade. Both getAllCompletedJobs and job retrieval
now use non-mutating patterns with bounded concurrency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@PhilWindle PhilWindle force-pushed the phil/a-718-audit-38-snapshot-sync-mutates-source-ids-array-via-splice branch from 186eee0 to 8a5ca2b Compare March 18, 2026 18:21
@PhilWindle PhilWindle marked this pull request as ready for review March 18, 2026 18:25
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