Skip to content

fix: allow terminal profile deletion - #1108

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

fix: allow terminal profile deletion#1108
piotr-iohk merged 2 commits into
masterfrom
codex/profile-delete-paykit-cleanup

Conversation

@ben-kaufman

@ben-kaufman ben-kaufman commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #1097.

Companion iOS fix: synonymdev/bitkit-ios#640

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.

  • Still attempts private endpoint revocation before deleting the profile.
  • Keeps the remote Pubky deletion authoritative, so a homeserver or connectivity failure still shows the existing retry/disconnect dialog.
  • Clears local Paykit state 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.

Preview

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

  • EditProfileViewModelTest.kt: verifies private cleanup failure does not block a successful Pubky deletion and local Paykit cleanup.
  • ./gradlew compileDevDebugKotlin passed.
  • ./gradlew testDevDebugUnitTest passed.
  • ./gradlew detekt passed with pre-existing findings outside this change.
  • git diff --check passed.

@ben-kaufman
ben-kaufman marked this pull request as ready for review July 24, 2026 10:31
@ben-kaufman
ben-kaufman requested a review from piotr-iohk July 24, 2026 10:31
@greptile-apps

greptile-apps Bot commented Jul 24, 2026

Copy link
Copy Markdown

Greptile Summary

Profile deletion now proceeds when private Paykit endpoint cleanup fails.

  • Attempts private endpoint cleanup before deleting the remote Pubky profile.
  • Clears local Paykit state after successful profile deletion.
  • Updates deletion confirmation copy and unit-test expectations.
  • Adds a changelog entry for the corrected deletion behavior.

Confidence Score: 5/5

The PR appears safe to merge because no eligible blocking failure remains in this follow-up review.

No blocking failure remains.

Important Files Changed

Filename Overview
app/src/main/java/to/bitkit/ui/screens/profile/EditProfileViewModel.kt Makes private Paykit cleanup best-effort while preserving remote Pubky deletion as the authoritative success condition.
app/src/main/res/values/strings.xml Updates the confirmation message to warn that contacts may retain previously shared information.
app/src/test/java/to/bitkit/ui/screens/profile/EditProfileViewModelTest.kt Verifies that failed private cleanup no longer blocks Pubky deletion, local cleanup, or the success effect.
changelog.d/next/1108.fixed.md Documents that private Paykit cleanup failures no longer block profile deletion.

Sequence Diagram

sequenceDiagram
    actor User
    participant VM as EditProfileViewModel
    participant Paykit as PrivatePaykitRepo
    participant Pubky as PubkyRepo
    User->>VM: Confirm profile deletion
    VM->>Paykit: removePublishedEndpointsForCleanup()
    Note over VM,Paykit: Cleanup failure does not stop deletion
    VM->>Pubky: deleteProfileWithSessionRetry()
    alt Pubky deletion succeeds
        VM->>Paykit: closeAndClear()
        VM-->>User: DeleteSuccess
    else Pubky deletion fails
        VM-->>User: Show retry/disconnect dialog
    end
Loading

Reviews (2): Last reviewed commit: "chore: rename changelog fragment" | 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

@ovitrif ovitrif 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.

utAck

@piotr-iohk piotr-iohk reopened this Jul 25, 2026
@piotr-iohk
piotr-iohk enabled auto-merge July 25, 2026 07:39
@piotr-iohk
piotr-iohk merged commit 03e043a into master Jul 25, 2026
48 of 59 checks passed
@piotr-iohk
piotr-iohk deleted the codex/profile-delete-paykit-cleanup branch July 25, 2026 08:07
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