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

notify onReady after updating graph (not before) #2

Merged
merged 1 commit into from Dec 4, 2018

Conversation

Projects
None yet
2 participants
@mmckegg
Contributor

mmckegg commented Dec 3, 2018

If you start an async call in ssb-friends while indexing is still in progress (e.g. hops via onReady), it won't return until after the indexing completes, however the result still does not have any data. This is because onReady is getting called before actually saving the index result. This makes the initial load/upgrade state broken in Patchwork.

This PR fixes the ordering so that onReady does not get called until after the result has been saved.

notify onReady after updating graph (not before)
so that callbacks on initial index (e.g. `getHops` or `getGraph`) actually have data!

mmckegg added a commit to ssbc/patchwork that referenced this pull request Dec 3, 2018

@dominictarr

This comment has been minimized.

Owner

dominictarr commented Dec 4, 2018

yup, makes sense!

@dominictarr dominictarr merged commit b2e1fa6 into dominictarr:master Dec 4, 2018

@dominictarr

This comment has been minimized.

Owner

dominictarr commented Dec 4, 2018

merged into 1.1.2, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment