Skip to content

fix: allow terminal profile deletion - #640

Merged
piotr-iohk merged 1 commit into
masterfrom
codex/profile-delete-paykit-cleanup
Jul 25, 2026
Merged

fix: allow terminal profile deletion#640
piotr-iohk merged 1 commit into
masterfrom
codex/profile-delete-paykit-cleanup

Conversation

@ben-kaufman

Copy link
Copy Markdown
Contributor

Description

This PR allows terminal Pubky profile deletion to continue when private Paykit endpoint cleanup cannot finish, such as when a contact is offline or a private link is still being established.

  • Reuses the existing best-effort private endpoint cleanup path before deleting the profile.
  • Keeps the remote Pubky deletion authoritative, so a homeserver or connectivity failure still reaches the existing retry/disconnect UI.
  • Preserves local Paykit cleanup after the Pubky profile is deleted.
  • Warns that contacts may retain profile and payment information shared with them previously.

Paykit lifecycle/concurrency hardening and E2E repository changes remain outside this PR.

Linked Issues/Tasks

Screenshot / Video

N/A — behavior and confirmation-copy update only.

QA Notes

Manual Tests

  • 1. Profile → Edit Profile → Delete Profile with an offline or still-linking contact → confirm: Pubky deletion proceeds instead of being blocked by private cleanup.
  • 2. Profile → Edit Profile → Delete Profile while the Pubky homeserver is unavailable → confirm: Unable to Delete Profile still offers retry or disconnect.
  • 3. Profile → Edit Profile → Delete Profile: confirmation explains that contacts may retain previously shared profile and payment information.

Automated Checks

  • Arm64 iOS simulator Debug build passed.
  • Translation validation passed with 0 errors.
  • SwiftFormat lint passed for the changed Swift file.
  • git diff --check passed.
  • PubkyProfileManagerTests.swift: 34 of 37 tests passed; three unchanged tests crash in the existing test host at Env.swift:211 because its documents directory is unavailable.

@greptile-apps

greptile-apps Bot commented Jul 24, 2026

Copy link
Copy Markdown

Greptile Summary

This PR makes private Paykit endpoint cleanup best-effort during terminal profile deletion.

  • Continues with authoritative remote Pubky profile deletion when private endpoint cleanup fails.
  • Retains existing remote-deletion failure handling and subsequent local Paykit cleanup.
  • Updates confirmation copy to warn that contacts may retain previously shared information.
  • Adds a changelog entry for the corrected deletion behavior.

Confidence Score: 5/5

The PR appears safe to merge, with the best-effort cleanup behavior and retained remote-deletion failure path matching the stated terminal deletion contract.

The changed flow still awaits all private cleanup attempts, only suppresses their aggregate failure, preserves errors from authoritative Pubky deletion, and clears local state after successful deletion.

Important Files Changed

Filename Overview
Bitkit/Managers/PubkyProfileManager.swift Changes terminal profile deletion to tolerate private Paykit cleanup failures while preserving authoritative remote deletion errors and final local sign-out cleanup.
Bitkit/Resources/Localization/en.lproj/Localizable.strings Revises deletion confirmation copy to disclose that previously shared profile and payment information may remain with contacts.
changelog.d/next/640.fixed.md Documents that failed private Paykit contact cleanup no longer blocks profile deletion.

Sequence Diagram

sequenceDiagram
    participant UI as Edit Profile UI
    participant PM as PubkyProfileManager
    participant Private as Private Paykit
    participant Pubky as Pubky Service
    UI->>PM: deleteProfile()
    PM->>Private: remove endpoints (best effort)
    alt cleanup fails
        Private-->>PM: error absorbed and marked pending
    else cleanup succeeds
        Private-->>PM: cleanup complete
    end
    PM->>Pubky: deletePaykitProfile()
    alt remote deletion fails
        Pubky-->>PM: throw error
        PM-->>UI: retry/disconnect flow
    else deleted or already missing
        PM->>PM: signOut without repeating private cleanup
        PM-->>UI: deletion complete
    end
Loading

Reviews (1): Last reviewed commit: "fix: allow terminal profile deletion" | Re-trigger Greptile

@piotr-iohk piotr-iohk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK

@piotr-iohk
piotr-iohk merged commit 7504ded into master Jul 25, 2026
40 of 52 checks passed
@piotr-iohk
piotr-iohk deleted the codex/profile-delete-paykit-cleanup branch July 25, 2026 07:37
@ovitrif ovitrif added this to the 2.5.0 milestone Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants