Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix naked property subscription handling #343

Merged
merged 1 commit into from
Nov 25, 2017
Merged

Conversation

tkurki
Copy link
Member

@tkurki tkurki commented Nov 22, 2017

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.

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.
@tkurki tkurki merged commit 3a90629 into master Nov 25, 2017
@tkurki tkurki deleted the root-delta-test branch November 25, 2017 16:09
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