Page MenuHomePhabricator

[lib] Update misc parts of `lib` to support `MinimallyEncodedThreadInfo`
ClosedPublic

Authored by atul on Nov 14 2023, 5:43 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 8, 10:05 PM
Unknown Object (File)
Fri, Nov 8, 10:05 PM
Unknown Object (File)
Fri, Nov 8, 10:05 PM
Unknown Object (File)
Fri, Nov 8, 10:05 PM
Unknown Object (File)
Fri, Nov 8, 10:05 PM
Unknown Object (File)
Fri, Nov 8, 10:02 PM
Unknown Object (File)
Fri, Nov 8, 9:24 PM
Unknown Object (File)
Fri, Nov 8, 6:26 AM
Subscribers
None

Details

Summary

Went through and made changes throughout lib to support MinimallyEncodedThreadInfo where changes required were limited to updating signature.

Next diffs will involve changes that need to be made to message-specs and Redux.


Depends on D9889

Test Plan

Trusting Flow

Diff Detail

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

Event Timeline

atul created this revision.

remove accidental eslint

atul published this revision for review.Nov 14 2023, 5:45 PM
atul planned changes to this revision.

Are there some places where we're expecting only ThreadInfo and not MinimallyEncodedThreadInfo (or the other way around)? Is it possible to modify ThreadInfo type to be what it already is or MinimallyEncodedThreadInfo (type ThreadInfo = { ... } | MinimallyEncodedThreadInfo)? That might be a more maintainable and much simpler approach.

In D9890#288332, @tomek wrote:

Are there some places where we're expecting only ThreadInfo and not MinimallyEncodedThreadInfo (or the other way around)? Is it possible to modify ThreadInfo type to be what it already is or MinimallyEncodedThreadInfo (type ThreadInfo = { ... } | MinimallyEncodedThreadInfo)? That might be a more maintainable and much simpler approach.

Yeah I think that makes sense, was thinking along those lines yesterday:

0751e5.png (400×1 px, 118 KB)

You're right that having to type RawThreadInfo | MinimallyEncodedRawThreadInfo everywhere would be super tedious.

Basically I think the best bet is:

  1. Continue refactoring by incorporating MinimallyEncoded* where we currently have RawThreadInfo/ThreadInfo/etc until Flow issues are resolved
  2. Rename existing ThreadInfo to LegacyThreadInfo (will only be really used on keyserver for supporting old clients)
  3. Rename existing MinimallyEncoded[Raw]ThreadInfo to [Raw]ThreadInfo

Doing this refactor incrementally is helpful because we can make progress while keeping flow happy vs. having a bunch of flow issues that we need to handle all at once

This revision is now accepted and ready to land.Nov 15 2023, 4:54 AM
This revision was landed with ongoing or failed builds.Nov 15 2023, 5:59 AM
This revision was automatically updated to reflect the committed changes.