Skip to content

Fix bulk insert observers reading stale component values - #342

Closed
Companion wants to merge 1 commit into
Ukendio:mainfrom
Companion:fix/bulk-insert-change-observer-values
Closed

Companion wants to merge 1 commit into
Ukendio:mainfrom
Companion:fix/bulk-insert-change-observer-values

Conversation

@Companion

Copy link
Copy Markdown

Brief Description of your Changes

Fixes #331

Store every value in a bulk insert before calling change observers when the entity stays in the same archetype

Observers can now read the updated values through world:get just like they can when the entity moves to another archetype

Impact of your Changes

  • Match the existing write then notify order of the moving path
  • Keep callback order and arguments unchanged
  • Preserve false values and skip nil writes
  • Add one linear pass over the batch before notifying observers

Tests Performed

  • Luau 0.703 full suite passes all 150 cases
  • New regression fails before the fix and passes after it
  • Cover complete batch visibility with reversed component order and false values
  • Check moving and nonmoving paths against world:set behavior
  • Analyzer reports the same 107 existing diagnostics as the main branch baseline

@Ukendio Ukendio closed this Oct 17, 2026
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.

bulk_insert fires on_change before writing the value when no archetype move occurs

2 participants