feat: support Pubky signup - #1224
Conversation
d02c926 to
09dff52
Compare
Greptile SummaryThis PR adds Pubky Ring signup URL parsing and scanner routing, registers the wallet-derived identity with the requested Homeserver, activates Paykit, and resumes profile setup through durable local state.
Confidence Score: 3/5This PR should not merge until signup activation can recover from the second network operation failing and pending profile setup can be exited without an immediate navigation loop. The new signup sequence can complete remote registration and authorization while leaving Bitkit without a local session, and the successful path's durable pending marker makes the CreateProfile back action ineffective. Files Needing Attention: app/src/main/java/to/bitkit/services/PaykitSdkService.kt, app/src/main/java/to/bitkit/repositories/PubkyRepo.kt, app/src/main/java/to/bitkit/ui/ContentView.kt
|
| Filename | Overview |
|---|---|
| app/src/main/java/to/bitkit/models/PubkyAuthRequest.kt | Adds strict Ring signup parsing, query validation, and conversion into the existing Pubky authorization request model. |
| app/src/main/java/to/bitkit/repositories/PubkyRepo.kt | Coordinates signup registration, authorization, activation, and pending profile state, but the multi-step flow can strand remotely completed signup without a local session. |
| app/src/main/java/to/bitkit/services/PaykitSdkService.kt | Adds registration without activation, discarding an activatable signup result and requiring a failure-prone second sign-in. |
| app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt | Routes Ring signup through the normal scanner while explicitly rejecting Pubky requests in payment-only contexts. |
| app/src/main/java/to/bitkit/ui/ContentView.kt | Resumes pending profile setup automatically, but conflicts with the unchanged dismissible CreateProfile back action. |
| app/src/main/java/to/bitkit/ui/screens/profile/PubkyAuthApprovalViewModel.kt | Dispatches Ring signup approval, handles existing identities, and dismisses the approval sheet before profile setup. |
Sequence Diagram
sequenceDiagram
participant Scanner
participant Approval as Approval UI
participant Repo as PubkyRepo
participant Server as Homeserver
participant App as Requesting app
participant Paykit
Scanner->>Approval: Pubky Ring signup request
Approval->>Repo: Approve signup
Repo->>Server: Register derived identity
Repo->>App: Approve authorization
Repo->>Paykit: Sign in and activate session
Paykit-->>Repo: Active local session
Repo-->>Approval: Dismiss approval
Repo->>Repo: Mark profile setup pending
Repo-->>Scanner: Navigate to profile setup
Reviews (1): Last reviewed commit: d02c926 | Re-trigger Greptile
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
447e781 to
36bfd02
Compare
174e4c8 to
504ae04
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
504ae04 to
94bc950
Compare
ea18746 to
f331ad8
Compare
21d5a06 to
a681dfc
Compare
f331ad8 to
ef49aa1
Compare
This comment was marked as resolved.
This comment was marked as resolved.
ef49aa1 to
ff24be9
Compare
This comment was marked as resolved.
This comment was marked as resolved.
ff24be9 to
f54f1f3
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
@jvsena42 Fixed this. Pubky auth links now enter the scan queue before the cached Paykit flag is ready. The scan reads the persisted setting before routing, so the cold-start path no longer drops the link while disabled Paykit and missing-wallet cases still stop. |
|
@ben-kaufman conflict |
Regtest APKDownload bitkit-dev-debug universal APK (expires in 30 days). |
jvsena42
left a comment
There was a problem hiding this comment.
✅ Approved with some observations
- ✅ On Loopky -> Click on sign in with ring -> selected Bitkit (with a Pubky identity) -> Authorize
- Could not test sign in on Pubky-ring 1.19 because of pubky/pubky-ring#375 . We can revisit the feature when the issue is fixed
addressed - manually confirmed

Description
pubkyring://signupand auth-bearingpubkyauth://signuprequests, plus directpubkyauth://direct_signupand parameter-only legacypubkyauth://signup, through the normal scanner and deep-link flow.This PR is stacked on #1200 and uses its Paykit rc51 authorization model. Ordinary Pubky App sign-in must use that grant-auth model; compatibility with the older sign-in request is intentionally outside this signup PR.
Preview
Not included; this reuses the existing scanner, authorization approval sheet, loading treatment, and profile setup UI.
QA Notes
Validation:
testDevDebugUnitTest: 2,346 tests passed on the restacked branch.compileDevDebugKotlinanddetektpassed.PubkyRepoTest.kt: 97 tests passed, including existing-key recovery, secure-storage errors, sign-in/profile failure retries, cancellation, and no-key signup. Detekt reports no changed-file findings.