Page MenuHomePhabricator

[lib] Update `convertClientDBThreadInfoToRawThreadInfo` to validate `ThreadCurrentUserInfo`
ClosedPublic

Authored by atul on Dec 12 2023, 12:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 24, 1:40 PM
Unknown Object (File)
Sun, Dec 22, 3:20 PM
Unknown Object (File)
Sat, Dec 14, 2:25 AM
Unknown Object (File)
Fri, Dec 13, 9:46 PM
Unknown Object (File)
Sun, Dec 1, 3:33 AM
Unknown Object (File)
Nov 12 2024, 12:49 PM
Unknown Object (File)
Nov 6 2024, 1:37 PM
Unknown Object (File)
Nov 6 2024, 12:35 AM
Subscribers
None

Details

Summary

Similar to D10313 and D10298, this diff addresses what we learned when testing D10297 that it's important that we validate the stringified JSON that we retrieve from ClientDBThreadInfo. Specifically, it's possible for ClientDBThreadInfo to have either stringified MinimallyEncodedThreadCurrentInfo or ThreadCurrentInfo (yes, we didn't end up renaming this to LegacyThreadCurrentInfo because we didn't end up needing a union type, but I will change the name for symmetry) stored in the currentUser field, and we should A. validate that the data is correctly formed and B. determine what format the data is in.


Depends on D10313

Test Plan

Will be tested along with changes in D10297 and D10298 and D10313.

Diff Detail

Repository
rCOMM Comm
Branch
master
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

atul published this revision for review.Dec 12 2023, 12:32 PM
atul added inline comments.
lib/utils/thread-ops-utils.js
54

Shortened so could keep the rawCurrentUser invariant message line under 80 characters and updated these as well to maintain symmetry.

When I'm rebasing I'll probably just make the comment changes in place for cleaner diffs.

fix (possible) minimal encoding of rawCurrentUser if not already minimally encoded.... just spent last 1.5 hours trying to figure out what was wrong, definitely going to add some invariants that would've broke "loudly" instead of erroneously encoding silently

This revision is now accepted and ready to land.Dec 12 2023, 4:52 PM
This revision was landed with ongoing or failed builds.Dec 13 2023, 1:34 PM
This revision was automatically updated to reflect the committed changes.