mikedilger / gossip

Gossip is a nostr client
Other
687 stars 77 forks source link

Follows list not cleared when identity is deleted #323

Closed optout21 closed 1 year ago

optout21 commented 1 year ago

Follows list is not cleared when identity is deleted or new identity imported.

To reproduce:

Similar result happens when generating a brand new identity. The only way I found to get rid of the follows of the removed identity is to purge the persisted files (~/.local/share/gossip)

Version: post 0.5.2 d61acc2dd6f86e6a9d7df247567740ef3bb8c6e4

mikedilger commented 1 year ago

Ok. We need to preserve the ability to follow people without having an identity at all, so I don't want to tie your follow list to your identity. While at it, I've always wanted to be able to follow people without doing so publicly (without tying it to my identity). If you have an identity those can be saved to a gossip-specific config event (tbd). And eventually we will support multiple identities. There are other issues surrounding this regarding showing whether your list is stale or not.

For now we can have a button to clear your local following list (independent of publication).

optout21 commented 1 year ago

Fair enough.

I separate button for clearing the follows list is a flexible, simple solution for this. BTW, I expected the 'PULL (Overwrite)' button to also reset the list before bringing it afresh, but that does not seem to be the case.

mikedilger commented 1 year ago

If pull overwrite isn't doing that, you should follow the code and see why. You'll see in people.rs a function follow_all with a merge parameter. If you pressed "Pull (Overwrite)" merge=false, which means the block where it explicitly unfollows everybody that is not on the new list, and does similar job in memory just below. If you figure out why it is not working, submit a PR.

I'm working on too many branches to keep track of to fork off another to handle this.

Edit: I'm sorry if my tone here isn't the best, I'm not pleased with my tone as of late. I'm rather frustrated at my lack of time conflicting with my desire to make gossip better.

mikedilger commented 1 year ago

I've made changes to how following list sync works today. Pull (Merge) had not been working for me, and the reason was my ContactList had been erased by some other client. Now gossip will make that obvious.

mikedilger commented 1 year ago

Ok done.

optout21 commented 1 year ago

Thanks. I'm having issues obtaining follower list in Gossip after a DB purge, but that may be a local issue of mine...

mikedilger commented 1 year ago

What happened to my data was that on April 1st, via the use of some other client which I don't recall, my contact list was erased (a new contact list clobbered it with no tags at all). But gossip still showed all my contacts and I didn't notice until the 14th, at which point I added new code to make it more obvious.

You should use some tool to pull down kind=3 pubkey=you from whatever relays you think that list is at and see what you find.