IndiePass / indiepass-ios

An IndieWeb app with extensions for sharing information to micropub endpoints and reading from microsub endpoints
https://indigenous.marksuth.dev
MIT License
45 stars 5 forks source link

Channel cache #229

Open mayo opened 6 years ago

mayo commented 6 years ago

I don't know the exact steps to get into this state, but I did something along the lines of:

  1. Connect to a microsub server (https://domain1.com/microsub)
  2. Load list of channels
  3. Shut down server, replace the software, etc.
  4. Go to channel list and pull down to reload

Result: I now see the channel list from both servers, even though the original server is long dead, and the new one has different channels. One of the old channels even shows 9 unread messages. Tapping on that channel shows zero messages inside. Tapping on "Load Mode Posts" shows "No More Posts".

Expected: I would expect the old channels to disappear, because the channel list at https://domain1.com/microsub no longer contains them, or at least ability to clear cache.

EdwardHinkle commented 6 years ago

Hi @mayo This issue and #224 are not likely the same. This issue is related to #197. When I built in the channel cache-ing I somehow missed the need to erase all previous channels when logging out of a Microsub account. So those channels are kind of zombie channels still hanging around but the new server doesn't know anything about them.

Essentially when I'm pulling in the channels list, if channels don't appear on it anymore, I should remove them from the cache. Also, if you log out it should remove all existing channels.

Thanks for bringing this issue up. Definitely should get fixed in the version that I'm working on currently. For the time being, if you delete the app and re-download it, it will clear out the channels cache so it doesn't drive you crazy.

mayo commented 6 years ago

@EdwardHinkle Ha! I didn't even think of logging out in between. I just continued using the account that was already logged in (but you're right, logging out doesn't clear them either).

I didn't mean to imply #224 was the same, just wondering if it had to do with caching. But you'd know better, I barely spent any time looking at the code so far!

EdwardHinkle commented 6 years ago

Ohhhhh, interesting! That makes sense.

I'm thinking #224 probably isn't caching because the caching works great for adding new channels (I do it all the time) it's just clearing out the old ones that has lots of bugs :) But it was a great idea!