Repository navigation
Fix drive-app install: join fragmented WS frames, drain app agent after its folder - #1818
Closed
michielbdejong wants to merge 2 commits into
Closed
michielbdejong wants to merge 2 commits into
michielbdejong wants to merge 2 commits into
Conversation
When the socket drops during a drive-app install, the App identities folder and the app's agent under it are both queued, and the reconnect drain sent agents first. The server admits a user-signed Agent resource through its parent's append right; with the folder not there yet it falls back to "only the agent itself may create its Agent resource" and answers 401, which failed the install (ontola/atomic-plugins#171). An agent whose parent is itself still queued now drains in the ordinary depth order, after that parent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Chromium sends a message larger than ~128 KB as a first frame with FIN unset plus continuation frames. actix-web-actors hands those over unjoined as `Message::Continuation`, and the handler's catch-all stopped the actor on them, dropping the socket without a Close frame. The browser saw 1006 and went offline; installing a drive app, whose entry point COMMIT carries its whole module, hit this every time (ontola/atomic-plugins#171). The handler now reassembles fragments up to the 16 MiB frame limit, ignores `Nop`, and closes with a status code on a protocol error instead of dropping the connection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
Landed on develop in 46562ff via the combined batch #1828 (green on Mancave, run 4639). Closing. Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes the host bug behind ontola/atomic-plugins#171: installing a drive app from the catalog dropped the WebSocket (1006, "Working offline"), then failed with
Unauthorized. Only atomic:agent:<app> itself may create its Agent resource; the commit was signed by atomic:agent:<user>. The traces and server log are from run 36113649083.There are two separate causes. Nothing re-signs a commit. The user-signed commit on the app agent is intended: the server accepts it through the App identities folder's append right. It fails only when it reaches the server before that folder exists.
1. The 1006: continuation frames kill the socket (server)
Binary(fin=false, 131000)followed byContinue(fin=true, 43341).Message::Continuationwithout joining them.WebSocketConnection::handlesent that to_ => ctx.stop(), which drops the TCP connection without a Close frame, so the browser reports 1006.COMMITcarries the whole plugin module. The server log shows its HTTP fallback atcontent-length: 174341, sent at the moment the socket dropped. So every install hit this.Nop, and on a protocol error it closes with a status code instead of dropping the connection. This needsactix-httpas a direct dependency, forws::Item.2. The 401: the reconnect drain sends agents first (
@tomic/lib)serverConnectedis false, so the rest ofcreateAppgets queued in the outbox: the App identities folder, the drive pointer, the app agent under the folder, and the grants.Store.outboxTierput everyatomic:agent:subject in tier 0, so it drained before its parent folder. The server'scheck_appendthen found no parent and fell back tocheck_agent_self_creation, which returns 401.installCatalogAppthrew on that, sohandOverAppKeynever ran and the page never navigated. When the install did get through, the app had no key or rights on the node, which shows up asNo write righton/app-write.Tests
browser/lib/src/issue-access-agent.test.ts, "an issued agent queued while offline": it queues the folder and the agent while offline, then drains against a stub server that refuses a child whose parent it hasn't seen. Before the fix it fails with the exact CI message.server/tests/it/ws_fragmented.rs: sends a ~100 KBCOMMITin 32 KB fragments and expectsCOMMIT_OK. Before the fix it fails withBroken pipe/Connection reset by peer.cargo test -p atomic-server --test it ws_: all pass.browser/libvitest: 988 pass.No UI changes.
🤖 Generated with Claude Code