Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Local-first, dids, wasm + OPFS, flutter, iroh, dht #1148
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
base: develop
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Local-first, dids, wasm + OPFS, flutter, iroh, dht #1148
Changes from 1 commit
5e622fe64a1cd96fa444228ec9fc40638982c0ff1b4766c3353a5d65612e22936c494f0af475d5b85b420ce229956a0a452da27e7a60cef6c5f7c563724a8ea7262b6bf4aa8fc4e11d6508d0af4cc72439a3cc9582c925041ed23c66bca67fbea72ea1cf93420fb07a47bbe7badbbc6c0ee4501e20d0ecc2b513c4780afb981884cbcf51e45d38bfd38d077898325f6e83fa39d110524ac7c729bb052569f0a4f69538b953dbb23096a0f814d430c417aa0e467a7ca0b727a7a4b2017d052ba0d2e9cdee05fcc6e3567f665278b608336f8866864e88bc26cfa7801ceb2c8b195c25c19bd7bd1207dae7cb1f627651a156bb56a4b3ae3a177185460d06382e09d35dfe1e0a0cd9b9fa1241a7d891458e4562ab776e7abbd3ad7d275da73e516c0ae9b72b6bf1e13e6812cfe184d4ccea8602cdfe60db06ffa886dcc59a7b1bc1283141de4997003b55e5ee25dec20a9d6fe859666ce3dd1d532ed23e0d71cf6becd0c022fa44118a99b2d1bec92ea2b3a4e14eb4cab804998b7bed43aa96b3829c13afec1ac16b285a6d8264dbe83b4d64736d7169350c598cbea9a5573018767a59593e8ee9e0f5c1085d0e774f4f161cc0b64fd70849220e9d1f480a93ac8875d5d8ebba1994bd1355feada0f5e7ae6918e24470854656885bc6e7906d84cac2799b14d44469af13073be8881aab151e47b4f3029ef751e7ecb8f03e411295b821e3da3b25c1aa17ef178b87a1bcb01857164800174a5ad2dbc50299f36190080f816cd42872b83db1043d5c9f824c81f3b3f329a4f245d78b449839d67d0222f5996935b9e4718be34899c7a73e71d915f7ae520d286587ec23bb62be0ac57969767a7dc7eb54a7b3ff667bc064e5717427be2e8852faf29fe1c4652f58392416cdf6e81654e99abf567321e95d8db031b01f2327ee35e20d4a5e0ca7e8e68a6e406868c36722ab21e48c2fa82c9ddfd1107c7c875a58d26e927398dd749c6db6a9b2cf5ab8879aa2281d187dd771c258f62b32c44b1a2cbd6d44118aeb80a503338b9ab0e961d09ac47c01bb7b2c7b8c1c21f985691caacbf5be9f341abae32f39200a88e4e5e0cf2c3c232db13415495b17435a2758664e837062d4e69a2369390155957256024a866c547f6a81449c31da1650264f77a7d199553dfbd4fc5832a7677b3cace36c903ee3b11e7d0774342d4ddbc9fdae412befb3fa7d657b5a9feead098e35656f31File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Two concurrent calls to `Resource.pushCommits()` both entered the `while (this._pendingCommits.length > 0)` drain loop and both POSTed the queued commit before either had a chance to `shift()` it. Symptom in dagger CI: Commit for did:ad:… has is_genesis: true, but the resource already exists. emitted from `lib/src/commit.rs:422`. Locally the server tolerates the duplicate (idempotent on same signature) so the bug is invisible; in the dagger single-core actix container the lookup→genesis-check window opens up enough that the second POST loses the TOCTOU and 500s. Trigger: `WSClient.handleOpen` runs `syncDirtyResources()` on every WS open. Under flaky network/auth conditions the WS reconnects twice in close succession (manual `store.reconnect()` + auto-retry on a slow auth response), each open fires a full `syncDirtyResources()`, and the second one runs in parallel because there's no re-entrance guard. Inside, when the resource has no unsaved Loro changes the sync calls `pushCommits()` directly — bypassing `save()`'s `hasQueue` / `inProgressCommit` guard. `pushCommits()` now coalesces concurrent calls onto a single in-flight drain via `inProgressPush`. The second caller observes the first call's POST result instead of re-POSTing. `tests/genesis-double-push.integration.test.ts` reproduces the race against a real spawned `atomic-server` and asserts exactly one `/commit` POST hits the network for two `pushCommits()` calls. Pre-fix the test sees 2 POSTs; post-fix it sees 1. Existing offline integration tests + unit suite still green; affected e2e specs (sync, file-upload- offline, offline-chatroom) pass cleanly locally.Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing