damus-io / damus

iOS nostr client
GNU General Public License v3.0
1.96k stars 288 forks source link

Damus auto switches my keypairs without me logging out, logging in #2058

Open alltheseas opened 3 months ago

alltheseas commented 3 months ago

what happens

As a multiple profile user on Damus iOS (i.e. main keys, plus multiple test keys) sometimes when I create one or more test keys, log out, and log back in to my main keys, Damus out of nowhere "swaps" my main keys with my test keys.

I do not log out of my main keys, and all of a sudden I see a screen with my test keys, as if I logged out with my main keys, and logged in with one of my test keys.

It's a bit surreal.

image

alltheseas commented 3 months ago

I am guessing maybe nostrdb @jb55

jb55 commented 3 months ago

On Fri, Mar 15, 2024 at 08:09:20AM -0700, alltheseas wrote:

what happens

As a multiple profile user on Damus iOS (i.e. main keys, plus multiple test keys) sometimes when I create one or more test keys, log out, and log back in to my main keys, Damus out of nowhere "swaps" my main keys with my test keys.

I do not log out of my main keys, and all of a sudden I see a screen with my test keys, as if I logged out with my main keys, and logged in with one of my test keys.

It's a bit surreal.

hmm weird, I have not experienced that.

alltheseas commented 3 months ago

happened again after log out, new test keypair creation, log out, log back in with my keys

jb55 commented 3 months ago

On Sat, Mar 30, 2024 at 05:41:35AM -0700, alltheseas wrote:

happened again after log out, new test keypair creation, log out, log back in with my keys

do you have very specific steps to reproduce?

alltheseas commented 3 months ago

Let me try to recreate reliably.

In this testing process, ran into a new bug where if I switch apps to copy my test keys to a text app, I restart the onboarding.

https://github.com/damus-io/damus/assets/64376233/372bfc99-ad95-4f00-97a8-d36b15897b87

alltheseas commented 3 months ago

I think bug is related to above.

Actions: Home, go to notifications, Log out, create account, copy nsec, swap app to text app, paste nsec, return to damus

Result: onboarding has restarted

Repeated 2/2 times.

Actions: New keys, copy nsec, continue (do not swap app),

Intermediate result: first screen viewed in damus is notification view (onboarding prompt was turned off in my settings),

Action(continued): follow account in universe, follow account via damus profile, log out (result: see get started screen), swap app to notes/github, swap back to damus, click on get started -> i am logged in to the test account again (without pasting my nsec)

alltheseas commented 3 months ago

How to recreate original issue:

Action: log out, create test keys (do not swap damus app to text editor), follow account in universe view, follow third party account via damus, log out

Action: Login with main keys, swap app, re-open Damus (intermediate result: no issue), close damus, open damus.

Result: I am logged out of my main keys and into the previous test account