Page MenuHomePhabricator

[lib] Always initialize messageStore.messages with startReached: false
ClosedPublic

Authored by ashoat on Oct 27 2022, 7:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 26, 5:22 PM
Unknown Object (File)
Tue, Nov 26, 5:21 PM
Unknown Object (File)
Tue, Nov 26, 5:21 PM
Unknown Object (File)
Sun, Nov 24, 11:41 AM
Unknown Object (File)
Nov 2 2024, 8:31 AM
Unknown Object (File)
Oct 22 2024, 11:07 PM
Unknown Object (File)
Oct 7 2024, 6:12 AM
Unknown Object (File)
Oct 7 2024, 6:12 AM
Subscribers

Details

Summary

More details in this Linear comment.

It's always safer to initialize with startReached: false. An erroneous startReached: false is always resolved when the keyserver responds that there are indeed no older messages, but an erroneous startReached: true can't really be resolved.

This code should typically not be triggered, since freshMessageStore is supposed to make sure that there is an entry in messageStore.threads for every entry in threadStore, and freshMessageStore correctly initializes startReached to false.

However, there are many things that can cause a thread to appear spontaneously, eg. the state check mechanism, or potentially a redux-persist issue as discussed in ENG-957 and ENG-1821. So we want to make sure we handle this correctly going forward.

Test Plan

To be honest, this one is hard to test. I think the change is safe

Diff Detail

Repository
rCOMM Comm
Branch
ashoat/startReached
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Note that D3350 made this change for freshMessageStore

atul published this revision for review.Oct 27 2022, 7:07 AM
atul accepted this revision.
This revision is now accepted and ready to land.Oct 27 2022, 7:07 AM
This revision was landed with ongoing or failed builds.Oct 27 2022, 7:12 AM
This revision was automatically updated to reflect the committed changes.