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 add/publish so we wait for the state to be loaded #160

Merged
merged 1 commit into from Feb 2, 2021

Conversation

arj03
Copy link
Member

@arj03 arj03 commented Feb 2, 2021

This fixed the problem found in ssbc/ssb-friends#49. Namely that we don't wait for the state to be loaded, so we end up with the wrong validate. Only publish and add really need this anyway which is why they are the only ones with this check.

@arj03
Copy link
Member Author

arj03 commented Feb 2, 2021

Must have been the random failure we have seen one time before. Works locally.

@github-actions
Copy link

github-actions bot commented Feb 2, 2021

Benchmark results

Part Duration
Migration (using ssb-db) 8218ms
Migration (alone) 3483ms
Memory usage without indexes 509.31 MB = 22.41 MB + etc
Initial indexing 2332ms
Initial indexing compat 767ms
Two indexes updating concurrently 975ms
key one initial 599ms
key two 3ms
key one again 4ms
latest root posts 311ms
latest posts 4ms
votes one initial 476ms
votes again 0ms
hasRoot 318ms
hasRoot again 0ms
author one posts 323ms
author two posts 81ms
dedicated author one posts 322ms
dedicated author one posts again 0ms
Maximum memory usage 608.51 MB = 59.43 MB + etc

test/basic.js Show resolved Hide resolved
Copy link
Member

@staltz staltz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find!

@arj03 arj03 merged commit 83e7dd1 into master Feb 2, 2021
@arj03 arj03 deleted the fix-add-publish branch February 2, 2021 19:41
@github-actions
Copy link

github-actions bot commented Feb 2, 2021

Benchmark results

Part Duration
Migration (using ssb-db) 10726ms
Migration (alone) 4659ms
Memory usage without indexes 507.79 MB = 25.95 MB + etc
Initial indexing 3570ms
Initial indexing compat 1065ms
Two indexes updating concurrently 1236ms
key one initial 752ms
key two 2ms
key one again 0ms
latest root posts 470ms
latest posts 11ms
votes one initial 658ms
votes again 0ms
hasRoot 447ms
hasRoot again 0ms
author one posts 450ms
author two posts 105ms
dedicated author one posts 465ms
dedicated author one posts again 0ms
Maximum memory usage 598.48 MB = 49.65 MB + etc

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

2 participants