Background
ChangeSetStack.get() currently treats a returned null as if a field were absent and continues searching lower scopes. That makes it impossible to distinguish an explicit update-to-null from no update in the current scope.
Scope
Add a regression test that defines the required behavior for explicit null values in nested scopes, and make the smallest production correction needed for the test to pass.
Test cases
- A lower scope stores a non-null field value.
- A higher scope explicitly stores
null for the same entity and field.
- Reading while the higher scope is active returns
null, not the lower value.
- Popping the higher scope restores the lower value.
- An entirely absent field still returns
null.
Acceptance criteria
- Presence and value are distinguished internally without changing the public API unnecessarily.
- Existing non-null stack-precedence behavior remains unchanged.
- A regression test fails against the current implementation and passes with the fix.
Background
ChangeSetStack.get()currently treats a returnednullas if a field were absent and continues searching lower scopes. That makes it impossible to distinguish an explicit update-to-null from no update in the current scope.Scope
Add a regression test that defines the required behavior for explicit null values in nested scopes, and make the smallest production correction needed for the test to pass.
Test cases
nullfor the same entity and field.null, not the lower value.null.Acceptance criteria