mucklet / mucklet-client

Web client for Mucklet.com, a textual world of roleplay.
Apache License 2.0
5 stars 8 forks source link

Fix handling of deleted characters on focus list and unfocus #272

Closed ItsAKelmi closed 3 months ago

ItsAKelmi commented 3 months ago

I discovered that if there is a deleted/not found character lingering on your focus list, it becomes impossible to use list focused and more importantly it is impossible to unfocus tab complete because the deleted character crashes the CharList provider.

This is just a minor quick fix to allow the client to work.

For a proper long-term fix, I think these lingering references that might get invalidated by deleted characters should be filtered out of the returned models (core.char.${charId}.focus.chars in this case) server-side.

anisus commented 3 months ago

Nice discovery, @ItsAKelmi ! The backend is currently not cleaning up linked data very well. So, if a character is deleted, other resources linking to that character (such as mails, watch lists, focus lists, etc.) is not cleaned up. This is something that should be improved.

But even so, there is no guarantee that a linked resource is successfully fetched even if it does exist - things like a service restart may cause it to fail - which means it is always a good idea to ensure the client doesn't crash if a list contains a Not found error rather than the expected model.

So, nice going!