fix: fix naked property subscription handling #343
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Subscription handling is broken: inputs like
{ path: '', value: { name: 'SomeBoat' }}
produce delta that has{"path":"name","value":"SomeBoat"}
.SubscriptionManager handles deltas' values independently: the
values are pushed to Bacon buses, bus per path, by StreamBundle.
When the bus's subscriptions fire SM reconstructs outgoing delta
from the incoming pathvalues. Previously StreamBundle normalized
pathvalues of naked properties, where path is empty, to synthesized
pathvalues with 'normal' paths and matching values. The generated
outgoing delta was then not naked, as it was generated from the
synthesized pathvalues.
This commit changes the handling so that the original, incoming
normalised pathvalue is pushed to buses for paths generated from
the object value's structure. Since we are pushing the normalised
pathvalues from the original delta the output pathvalues match
the incoming data.