HomePhabricator
Diffusion Comm 61db92aabe75

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

Description

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

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

Reviewers: palys-swm, atul

Reviewed By: atul

Subscribers: benschac, Adrian, karol-bisztyga

Differential Revision: https://phabricator.ashoat.com/D3350

Details

Provenance
ashoatAuthored on Mar 6 2022, 12:45 PM
Reviewer
atul
Differential Revision
D3350: [lib] Don't assume freshMessageStore always has messages for a thread
Parents
rCOMM97cea65d1b74: [server] Always filter message queries by message creation time
Branches
Unknown
Tags
Unknown