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 bug with switchC #53

Closed
dakom opened this issue Jan 31, 2018 · 5 comments
Closed

Fix bug with switchC #53

dakom opened this issue Jan 31, 2018 · 5 comments
Labels

Comments

@dakom
Copy link
Contributor

dakom commented Jan 31, 2018

discussion @ http://sodium.nz/t/lost-cells-in-switch/267

failing test @

test('map + nested data/lift (no Transaction)', (done) => {

@dakom dakom added the bug label Jan 31, 2018
@dakom
Copy link
Contributor Author

dakom commented Jan 31, 2018

In the switch-fix branch, I copied the fix @jam40jeff added to the c# version. It's currently unmerged due to getting a "send was invoked before listeners were registered" error.

Any ideas?

The added code is essentially here:

if(this.finishedPriorityQueue) {

The line that triggers the error is here:

.switchC(cTotal.map(data => data.cValue))

It seems to be thrown when the action is run here:

@ziriax
Copy link

ziriax commented Jan 31, 2018

This reminds me of #45

@jam40jeff
Copy link
Contributor

I believe the problem here is that Cell.apply calls Operational.Value. The initial value is usually returned later because of the spark stream in Operational.Value. However, when this is called during the "last" phase of the transaction, it attempts to send the value through right away, likely before the rest of the listeners have had a chance to register themselves. I'm not sure what can be done to work around this as I don't know enough about the TypeScript implementation.

@jam40jeff
Copy link
Contributor

jam40jeff commented Feb 2, 2018

I committed a fix for this to the switch-fix branch.

@dakom
Copy link
Contributor Author

dakom commented Feb 2, 2018

Merged, thanks @jam40jeff !

@dakom dakom closed this as completed Feb 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants