runbox / runbox7

Runbox 7 web app
Other
127 stars 24 forks source link

fix(messagecache): Load message contents whenever we encounter them #1513

Closed castaway closed 9 months ago

castaway commented 10 months ago

There are many sentry-errors resulting from the message list drawing code attempting to fetch the message contents from the cache, when the cache hasnt been created or updated yet (that happens after the canvas has been painted with the message list)

This fills the cache as we look for the data (using promises so without interrupting the canvas drawing)

castaway commented 9 months ago

Notes for reviewers:

The messageCache contains the actual message contents, generated / filled when getMessageContents is called. We don't need this data for the message list (unless summaries are on!), however we attempt to fill the message content slot every time we fetch the message data in general.

Before this update we were fetching from cachedMessageContents in getDocData, before the cache had been filled, so there was a lot of "this cache contains null". Instead I have made it call the full getMessageContents (aka updateMessageText), which is also what we call after the canvas has been painted