Repository navigation
Conversation
Signed-off-by: jm <jm@squareup.com> Co-authored-by: Codex <noreply@openai.com> Signed-off-by: jm <jm@squareup.com>
Signed-off-by: jm <jm@squareup.com> Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: jm <jm@squareup.com> Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: jm <jm@squareup.com> Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: jm <jm@squareup.com>
Signed-off-by: jm <jm@squareup.com>
Signed-off-by: jm <jm@squareup.com> Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: jm <jm@squareup.com>
Signed-off-by: jm <jm@squareup.com>
…ation Signed-off-by: jm <jm@squareup.com>
…ation Signed-off-by: jm <jm@squareup.com>
* commit '4353f060f407f63cf79765a4a960aa73d18ca2de': test(desktop): bind duplicate voice players to message IDs Signed-off-by: jm <jm@squareup.com>
## Summary Fix community removal failing with “Expected exactly one endpoint grant for push lease revocation” when saved push state exists but the current build has no cached grant, including builds without a push gateway. When the community has a saved installation ID, journal its targeted revocation without requiring the grant. An unknown grant expiry stays unknown: retain cleanup credentials until the relay accepts the revocation. Existing known-expiry cleanup and legacy grant-based addressing remain unchanged. ### Related issue No matching open issue found. Follows [the durable revocation outbox](#8706). ### Testing The new regression fails with the reported error on the preceding implementation. It now verifies missing-grant enqueue, offline retry, persistence across restart, the exact lease address and eventual cleanup after acceptance. On a physical iPhone with the fix applied to the onboarding test build, the previously failing community removal succeeded. Unknown-expiry records retain their signing key in secure storage until successful revocation. Downgrading to a client that requires an integer expiry will reject those pending records. Signed-off-by: John Tennant <jtennant@squareup.com> Co-authored-by: Aaron <f425b86c3b780d43f8d9cf1802429d04dd985bf92eac44fca9468b5ad3887c5e@buzz.block.builderlab.xyz>
joahg
left a comment
There was a problem hiding this comment.
🤖 Read the outbox split into gateway-only and relay records, the shared-grant recheck at execution time, and the Swift revoke/settle paths; each cleanup is journaled before native inventory is erased. P3: records carrying a gateway target are exempt from the expiresAt purge, so a gateway rejection that never clears (e.g. a non-retryable 4xx) retries forever; worth confirming only transient errors reach that path. Physical-device App Attest/APNs verification is still pending per the description.
Signed-off-by: jm <jm@squareup.com>
Signed-off-by: jm <jm@squareup.com>
Signed-off-by: jm <jm@squareup.com> Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: jm <jm@squareup.com> Co-authored-by: Codex <noreply@openai.com>
joahg
left a comment
There was a problem hiding this comment.
🤖 Re-approving. Most of the new diff adapts to the base's nullable expiresAt and HostedRelayAuth. The one semantic change, journaling a relay-only revocation when a community has a pushLeaseInstallationId but no matching grant, is null-safe: grant! only runs when exactly one grant matched. P3: records with a null expiresAt retry forever against a dead relay and keep the nsec in secure storage, so a max age would bound that.
wesbillman
left a comment
There was a problem hiding this comment.
🤖 Star Lord: changes needed at 61d992d. Source-only review; two first-pass lanes were incomplete and the corroborating second pass was not blind. Physical-device push remains unverified.
| "relayOrigin": pending.relayOrigin, "relayPubkey": pending.relayPubkey, | ||
| "installationId": pending.installationId, "endpointGrant": "", | ||
| "endpointHash": pending.endpointHash, "endpointEpoch": 1, | ||
| "generation": max(1, pending.delegationGeneration), "expiresAt": pending.expiresAt, |
There was a problem hiding this comment.
🤖 [P2] Preserve the pending enrollment’s known installation identity. If A and B share installation H / relay key K, B has an interrupted renewal, and A is disabled or removed while B stays enabled, this projection replaces B’s saved grant with a pending map that omits H. The Dart sharing checks then compare A’s H to B’s null and permit cleanup; revokeDelegation(settlePending: true) settles B’s renewal and revokes that resulting delegation too. B silently loses push despite remaining opted in. Export the known pending installation handle so the sharing checks protect B, and add an interrupted-renewal + sibling-opt-out regression journey.
brow
left a comment
There was a problem hiding this comment.
🤖 Tom's pre-review recommends rework on this head (61d992d). Three problems:
- An enabled sibling's delegation can be revoked. While community B has an unfinished renewal,
endpointGrantsinAppDelegate.swiftreplaces B's saved grant with the pending entry and dropsgatewayInstallationHandle, so the three Dart sharing checks (enqueueCommunity,reconcileGatewayCleanup, the outbox publisher) read B as unshared when community A is turned off or removed, andrevokeDelegation(settlePending: true)settles B's renewal and revokes it. B gets no push, with its switch still on, until its next renewal, reconnect or restart. Exporting one handle is not enough (B can retain one installation and have a pending replacement on another): the bridge needs both the retained and the pending (installation handle, relay signer) pairs, all three checks need their union, and an already journaled cleanup has to stay pending rather than complete while ownership is unresolved. #9161 carries the same code. - A removed community's signing key is kept. The gateway-only record is
record.copyWith(gatewayOnly: true), which keepsnsec, and that record is exempt from the expiry purge and has no terminal state, so the key stays in secure storage until the gateway revoke succeeds. Droppingnsecfrom the gateway-only copy resolves it (the publisher never uses it there). - A failed opt-out leaves notifications showing.
setPushNotificationsEnabled(false)now awaits the cleanup enqueue beforesyncCommunitySnapshot, so if the native grants read or the secure-storage write throws, the notification extension keeps the muted community in its snapshot and shows its messages with sender and text, and the immediate tombstone attempt is skipped. Exporting the snapshot before journaling resolves it.
Turning off push or removing a community must retire its gateway permission and relay lease after a restart or lost response. Persist the two cleanup operations separately, so either can finish while the other is unavailable. Journal the gateway target before native revocation can erase it, and retry while the relay is disconnected. Preserve shared grants, installation/signer ownership, and stale-enrollment protection.
Validation: 67 focused Flutter tests and clean mobile analysis, covering either cleanup operation failing, restart recovery, opt-out, and shared ownership. The tests mock native callbacks; physical-device App Attest/APNs verification remains pending.
Stack (merge in order): #8673 → #8703 → #8704 → #8705 → #8706 → #8707 → #8708.