bleakgrey / tootle

GTK-based Mastodon client for Linux
GNU General Public License v3.0
401 stars 61 forks source link

Resolve view entities on instance switch #189

Closed ranfdev closed 3 years ago

ranfdev commented 4 years ago

Problem: If you switch account inside views requiring instance-specific IDs, everything breaks: sometimes inconsistent data will be loaded, sometimes nothing can be loaded at all, because the corresponding ID in the new instance doesn't exist.

How to reproduce: Steps to reproduce the behavior:

  1. Add 2 accounts to tootle. They must be from different instances
  2. Open the profile of someone
  3. Switch to an account in a different instance.

Screenshots: Before switching account (everything is correct here): Screenshot from 2020-07-08 11-22-19 After switching accounts: Screenshot from 2020-07-08 11-22-30

ranfdev commented 4 years ago

I understand being able to switch accounts from everywhere can be useful, but it's just not possible, unless you map the IDs between instances (but I have no idea on how to implement this).

bleakgrey commented 4 years ago

There's no need to use IDs. Account and status entities contain the url field which can be resolved by the instance (confirmed to work through the Search view).

To implement this behavior, all it would take is introduce an invalidation mechanism that checks if the instance has changed, ask the new instance to resolve the entity by its url, and replace the old entity with the response.