Page MenuHomePhabricator

[lib] Stop shimming SIDEBAR_SOURCE when keyserver can't load source message
ClosedPublic

Authored by ashoat on Fri, May 3, 7:21 PM.
Tags
None
Referenced Files
F1820491: D11870.id39867.diff
Wed, May 22, 12:43 AM
F1820490: D11870.id39776.diff
Wed, May 22, 12:43 AM
Unknown Object (File)
Tue, May 21, 2:28 AM
Unknown Object (File)
Thu, May 16, 12:29 AM
Unknown Object (File)
Thu, May 16, 12:29 AM
Unknown Object (File)
Mon, May 13, 6:54 AM
Unknown Object (File)
Sun, May 12, 10:26 AM
Unknown Object (File)
Sat, May 11, 9:57 PM
Subscribers

Details

Summary

This behavior was initially introduced in D590. At the time, we were shimming SIDEBAR_SOURCE on codeVersions older than 75. We eventually stopped supporting versions that old, and now UNSUPPORTED is only sent for a SIDEBAR_SOURCE if the sourceMessage is missing.

Since we include SIDEBAR_SOURCE in localUnshimTypes, the UNSUPPORTED message actually gets unshimmed immediately upon being received on the client, which negates the purpose of shimming it in the first place. So it makes no sense to both have the unshimming logic, and to include SIDEBAR_SOURCE in localUnshimTypes.

I initially considered removing SIDEBAR_SOURCE from localUnshimTypes, which would mean that the message would just appear as the robotext "first message in thread". This seemed like @tomek's initial intention when making the change in D590.

But it looks like following this discussion in D632, @tomek added an if (!sourceMessage) return null condition to what is now createMessageInfo, which means that without the unshimming logic, the SIDEBAR_SOURCE simply would not be rendered on the client.

I tested both solutions and found that if the client couldn't find the SIDEBAR_SOURCE in the MessageStore for the child thread, it would just pull it from the parent thread in the MessageStore. (I'm guessing this exists to make the pending thread work.) Comparing the two visual results below, it seemed like simply not shimming (and letting the client ignore the SIDEBAR_SOURCE) was a better option than shimming it as "first message in thread".

Test Plan

Here's what it looks like if we remove SIDEBAR_SOURCE from localUnshimTypes and shim the SIDEBAR_SOURCE message on the keyserver side:

Screenshot 2024-05-03 at 7.04.00 PM.png (2×1 px, 802 KB)

Here's what this solution looks like, where we remove the shimming logic and send a SIDEBAR_SOURCE without a sourceMessage to the client:

Screenshot 2024-05-03 at 7.05.29 PM.png (2×1 px, 794 KB)

Note that I checked it as a sender and recipient, and it looked the same on both. Also tried logging out and then back in as the sender, and still saw the same thing.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable