Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added Delete Account UI #80 #1518

Merged
merged 4 commits into from
Sep 20, 2024
Merged

added Delete Account UI #80 #1518

merged 4 commits into from
Sep 20, 2024

Conversation

bryanmontz
Copy link
Contributor

Issues covered

#80

Description

Adds the UI associated with deleting a user's account.

How to test

While signed in to an account that you don't mind being deleted...

  1. Navigate to the Settings view.
  2. Scroll to the bottom.
  3. Tap the Delete Account button.
  4. At the confirmation alert, tap the Delete button.

At this point, a NIP-62 Request to Vanish event will be published to all the user's relays and the account will be signed out locally.

Screenshots/Video

nos 80

Simulator Screenshot - iPhone 15 - 2024-09-18 at 07 51 43

message: { TextState(String(localized: .localizable.deleteAccountDescription)) }
)
}
.clipShape(Capsule())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that this could be added into ActionButton directly instead of having its more manual corner rounding method, but I wasn't sure.

Copy link
Member

Choose a reason for hiding this comment

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

Is the more manual method you are referring to the .cornerRadius() modifier? I think just a plain Capsule() is something we'd need to run past Sebastian, because I'm not sure how pick he is about using the exact radius he has in Figma on the corners. It seems like Capsule would scale more elegantly to larger text sizes so I'm in favor of that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's what I meant. I can ask Sebastian about it.

Copy link
Member

@mplorentz mplorentz left a comment

Choose a reason for hiding this comment

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

Hey Bryan, this looks good and publishes the NIP-62 event as described in the ticket. However as I'm playing with it I think a few more changes are necessary.

  • Until we have implemented this on the server side it doesn't make sense to deploy it to users. Can you lock the button behind a feature flag for now?
  • If you log back in to the account you just deleted it still shows all your data. Obviously when some/most relays implement this NIP that will help, but I think we should do a couple more mitigations:
  • Let's drop all tables on sqlite on logout. That's something we should have been doing anyway. Ideally we could use PersistenceController.setUp(erasing: true) but I'm not sure how our Dependencies library will handle a new instance of PersistenceController. We might need to NSBatchDelete all the models individually.
  • I think we should overwrite the user's kind 0 and kind 3. Maybe we should check with Linda on this one, but I think publishing an empty profile that says "Account deleted" in the name fields or something would go a long way towards signaling the user's intentions as much as possible, especially for relays and clients that don't support NIP-62. We could also publish an empty kind 3 (just make sure that it gets published to the user's relays. I could see it publishing to an empty list of relays because we are deleting their relay list with this action).
  • In design review we talked about adding more friction before the account deletion takes place to prevent accidental taps. I left a comment on the ticket to follow up on that.

What are your thoughts? I'm fine with all this being in separate PRs, except for the feature flag.

message: { TextState(String(localized: .localizable.deleteAccountDescription)) }
)
}
.clipShape(Capsule())
Copy link
Member

Choose a reason for hiding this comment

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

Is the more manual method you are referring to the .cornerRadius() modifier? I think just a plain Capsule() is something we'd need to run past Sebastian, because I'm not sure how pick he is about using the exact radius he has in Figma on the corners. It seems like Capsule would scale more elegantly to larger text sizes so I'm in favor of that.

@bryanmontz
Copy link
Contributor Author

@mplorentz Yeah, I think that makes sense. I added a feature flag to this so we can get it merged, then I can tackle the other items you mentioned in one or more other PRs. Thanks for being thoughtful about user data like this!

@bryanmontz bryanmontz added this pull request to the merge queue Sep 20, 2024
Merged via the queue into main with commit 2565eb8 Sep 20, 2024
4 checks passed
@bryanmontz bryanmontz deleted the bdm/80-delete-account-ui branch September 20, 2024 11:14
@bryanmontz
Copy link
Contributor Author

@mplorentz Ticket for deleting all content on sign out: #1528

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.

2 participants