build: resume a grant sign-in when its relay poll dies - #298
Merged
Merged
Conversation
…ll dies Picks up pubky-core-ffi-fork#7. When a grant sign-in's relay long-poll dies, the FFI now restores the flow onto the same relay channel, where the approval waits in the inbox for ~5 minutes, instead of failing, so the user never approves twice. On the emulator the failure was the relay's name not resolving through the system resolver: an ~18s lookup timeout, longer than it takes to approve. Native libraries only (Android's four ABIs, the iOS xcframework, the macOS and Linux desktop rows); the generated bindings are byte-identical. The two KDocs and the Architecture.md paragraph that said a failed poll has no in-place retry now describe the resume and its bounds. Verified on the emulator with Bitkit as the signer, through a 20s network cut. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QC3jMBnPioeidFuV1JjEQ6
Journey 01 with Bitkit as the signer: sign-in completes through a 20s network cut, the session revalidates and the deck list loads. The self-tag write gets a 403 from a per-user write-path quota on that identity's staging account, not from the grant — a grant for another account writes the same path. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QC3jMBnPioeidFuV1JjEQ6
jvsena42
marked this pull request as ready for review
September 11, 2026 00:49
jvsena42
enabled auto-merge
September 11, 2026 00:54
This was referenced Sep 14, 2026
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.
Stacked on #296 (base
feat/restore-grant-auth). GitHub's stacked PRs aren't enabled for this repo, so this is a plain stack: merge #296 first, then retarget this tomain.Picks up jvsena42/pubky-core-ffi-fork#7. When a grant sign-in's relay long-poll dies, the FFI restores the flow onto the same relay channel instead of failing. The approval waits in the relay inbox for ~5 minutes, so the user never approves twice.
Why
On the emulator the "HTTP transport error … httprelay.pubky.app" sign-in failure was DNS, not a cut long-poll. The full cause chain ends
dns error: failed to lookup address information: No address associated with hostname: an ~18 s system-resolver timeout, then instant failures from its cache. That outlasts the time it takes to approve. Bitkit's approval was measured landing 2.7 s after Loopky had given up, in an inbox nobody read.What's in it
RingAuthFlowHandle,loopky login) and the Architecture §13 paragraph that said a failed poll has no in-place retry now describe the resume and its bounds.journeys/RESULTS.mdentry for the run below.The resume's rules, from fork#7: it rejoins only when the failing URL is the relay's own (a homeserver-side failure comes after the approval was ACKed); it rides out ≤ 90 s of outage, backing off 1→8 s; and it stops at 170 s, just under
OnboardingViewModel's 3-minute approval timeout, which can't interrupt the blocking call.Verified on the emulator, with Bitkit as the signer
session saved→SUCCESS403 Write to this path is not allowed(see below)That run used a 60 s outage allowance; fork#7 ships 90 s, because 55 of the 60 were used.
:shared:jvmTest(real desktoplibpubkycore),:cli:test,assembleDebugand the iOS simulator build pass.Not Loopky, but worth knowing
allowed_write_pathsquota check. A grant with the sameclient_idand caps, for another staging account, writes the same/pub/pubky.app/tags/<id>path fine. Raised on feat: support Pubky signup synonymdev/bitkit-android#1224, together with two Bitkit quirks: it drops a deep link that arrives during its cold start, and it doesn't return viax-success.OnboardingViewModel's 3-minute timeout on a healthy link, the VM reports a timeout and discards the session the FFI just collected.withTimeoutOrNullcan't interrupt the blocking call (Architecture §13.10).🤖 Generated with Claude Code
https://claude.ai/code/session_01QC3jMBnPioeidFuV1JjEQ6