Page MenuHomePhabricator

[lib] Don't assume freshMessageStore always has messages for a thread
ClosedPublic

Authored by ashoat on Mar 6 2022, 3:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 25, 2:37 PM
Unknown Object (File)
Mon, Nov 25, 1:49 PM
Unknown Object (File)
Nov 6 2024, 11:36 AM
Unknown Object (File)
Nov 2 2024, 8:31 AM
Unknown Object (File)
Nov 2 2024, 3:02 AM
Unknown Object (File)
Oct 27 2024, 12:58 AM
Unknown Object (File)
Oct 26 2024, 8:12 PM
Unknown Object (File)
Oct 26 2024, 8:17 AM

Details

Summary

Given the changes in the previous diff, we can no longer assume that if a thread has messages, at least one of those messages will be present in a fresh MessageStore.

There should be no threads with zero messages anyways, so this change should be safe. In the worst case, if we have some database corruption and threads exist with zero messages, this diff will force a server call to try and fetch the messages. After the server call returns, startReached should be correctly flipped to true.

Depends On D3349

Test Plan

I decreased defaultMaxMessageAge such that no messages got loaded at all, and made sure that when I opened a thread without messages, the messages were fetched

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ashoat requested review of this revision.Mar 6 2022, 3:59 PM
This revision is now accepted and ready to land.Mar 7 2022, 10:19 PM