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 firebaseObject destroyed caused delayed on('value') update failure. #888

Conversation

ulion
Copy link
Contributor

@ulion ulion commented Dec 20, 2016

Description

Fix a bug, which was triggered when a node set to null while the firebaseObject is on it.
the on('value') got triggered with snap value null, which call the applyUpdate method, and it delay the call with angular's $evalAsync method, but when that code finally be called, the firebaseObject was already set to null due to the destroy call.

the similar fix was already added to the error callback just below this code block, should also add to this update callback.

@jwngr
Copy link

jwngr commented Dec 20, 2016

Thanks for the pull request. For tracking purposes, can you please open a new issue and include a repro? Ideally we'd also have a test case here which reproduces the issue.

Overall, the change looks good to me, although @katowulf is the expert in this part of the code.

@jwngr jwngr closed this Dec 20, 2016
@ulion
Copy link
Contributor Author

ulion commented Dec 20, 2016 via email

@jwngr jwngr reopened this Dec 20, 2016
@jwngr
Copy link

jwngr commented Dec 20, 2016

Cool, thanks @ulion. I'll let @katowulf take it from here.

@katowulf
Copy link
Contributor

This update seems fine, but using synchronized objects in a synchronized array is unsupported and shouldn't be necessary. The array already handles sync of all the records, so there's no reason to be created additional overhead and listeners.

In all cases in the last several years that people have done this, it was completely unnecessary and redundant, or it was a hack that could have been implemented elegantly and more efficiently by using $extend.

@katowulf katowulf assigned jwngr and unassigned katowulf Dec 20, 2016
@katowulf
Copy link
Contributor

lgtm

@jwngr jwngr merged commit 99fbb40 into FirebaseExtended:master Dec 20, 2016
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.

None yet

3 participants