cheeaun / phanpy

A minimalistic opinionated Mastodon web client
https://phanpy.social
MIT License
935 stars 85 forks source link

Post Visibility Preference seems to be out of sync #565

Open AdamasFR opened 3 weeks ago

AdamasFR commented 3 weeks ago

Describe the bug I have two Mastodon account : one that is private and has private post visibility enabled as default and the other one is public and has public post visibility enabled.

Weirdly, on phanpy.social and dev.phanpy.social, I have a bug that is bothering me a lot : When I switch to my private account, the preferences of the public account are applied, and when I switch to the public account, this is the preferences of the private account that are applied.

I have checked it times and times again. I have three Phanpy icons on my homescreen, Phanpy.social, Dev and a local instance. I can't seem to reproduce it on my local dev env (of course). I was checking the code and according to settings.jsx:46, there may be a caching issue with the endpoint.

This issue caused me to post stuff in public that wasn't meant to and I fear I'm not alone.

Also, this issue is mainly for tracking, I'm going to check what's happening and I'm gonna try to fix it. :)

To Reproduce Get two account on the same instance with the supplied setup discussed above. Use it in an iOS PWA. Add both account to Phanpy. Switch between accounts.

Expected behavior The right preference of the account should show up.

Smartphone (please complete the following information):

Additional context I did not reproduced it on Firefox Desktop but I did reproduced it on Safari Desktop.

cheeaun commented 3 weeks ago

@AdamasFR in your reproduction steps, how do you know that the post visibility pref is wrong? Open Settings and check 'Default visibility' setting?

I did not reproduced it on Firefox Desktop but I did reproduced it on Safari Desktop.

If it's browser-specific, could be some race condition in the code 🤔 Will need to investigate.

AdamasFR commented 3 weeks ago

@cheeaun No, I just go directly to posting and I look at the globe or the lock! And I also checked the preference json in Safari's Dev panel, it was also wrong 🤔