papercups_flutter icon indicating copy to clipboard operation
papercups_flutter copied to clipboard

Add cache restoration

Open steebchen opened this issue 2 years ago • 2 comments

When re-opening the widget, it takes some time until the history is fetched. This is obviously not ideal as it takes a few seconds until the user can see the history, but it also introduces another problem, which is that it actually creates a new conversation for just that messages. Once it loads, the new conversion still appears in the admin conversations panel, but once loaded the old conversion is used.

A simple workaround for this might be to just add a loading indicator and prevent the user from sending messages until fully loaded, which would automatically prevent this bug where it creates a new conversation. Ideally it would just load faster, and that could probably be achieved by caching the chat history. Maybe the user can provide an optional store to cache the data, like a hive box (which I for example use anyway).

steebchen avatar Aug 21 '21 18:08 steebchen

This is linked to #56 . Closing the other issue as this seems to be a more general solution which requires less dependencies, the downside being that this implementation would require more work from the app developer and we'd have to assume the developer will store everything correctly as opposed to papercups_flutter doing the heavy lifting.

aguilaair avatar Aug 21 '21 18:08 aguilaair

I currently have very limited time to work on papercups_flutter, but if anyone want to volunteer I'd be more than happy to review PRs

aguilaair avatar Aug 21 '21 18:08 aguilaair