Closed Swiip closed 4 years ago
It seems to work at this point. Two things I want to precise:
I replaced the MessageProvider
and replaced by a use***Cache
which create a sort of sub-cache inside the main one. It seems simpler to me instead of stacking contexts. Update management for the cache is located next to it.
The useMessageCache
and the useConversationCache
are containing the same data as the localCache
of useElements
. It should be possible to link data from useElements
to other cache to remove duplication. But it could be complicated for a "not so important" memory gain.
After different attempts, I fallback on cache inside independants contexts. It's the best solution I found to manage futur eventual unloading.
That and new event management and some new tests. I think it's ok to merge now.
The question of cache duplication can be handled later.
EDIT: final situation
Motivations: caches implementations for message and conversation was a bit messy. But more important, lots of event updates was missed.
Remains a question about cache duplication in useElements and useMessage/useConversation. It will be addressed in another PR (if addressed)