HomePhabricator
Diffusion Comm 878c958c284e

[lib] Add `minimallyEncoded` discriminator property to…

Description

[lib] Add minimallyEncoded discriminator property to MinimallyEncodedRawThreadInfo

Summary:
As part of refactoring keyserver/native/web, there are places where we need to replace RawThreadInfo with RawThreadInfo | MinimallyEncodedRawThreadInfo. However, both types currently have the exact same keys, so it's difficult to refine types without duplicating functions, "drilling down" minimallyEncoded boolean to downstream functions, etc.

Instead, we add minimallyEncoded discriminator property to allow for more precise type refinement b/w RawThreadInfo and MinimallyEncodedRawThreadInfo.

Here's kind of what I'm going for: https://flow.org/try/#1N4Igxg9gdgZglgcxALlAIwIZoKYBsD6uEEAztvhgE6UYCe+JADpdhgCYowa5kA0I2KAFcAtiRQAXSkOz9sADwxgJ+NPTbYuQ3BMnTZA+Y2yU4IwRO4A6SFBIrGVDGM7c+IFkolXpUCWewUEAwhCQgRDH8wEH4hMnwROHlsNnw4KHwwSLAAC3wANyo4LFxscWQuHgMNZmwsiRSAWglaY1cq-hIAa2wJXNpG4Vxcdvdu3v7B0RxKUYMhKDBSqmbWwOQpGVioKDqykioB9MLTDD857d2wfcPGiEZ-aG5G3Ix0i5AFg5hsRoRehqUEiNMgSQHlSruBZxJrMcJwMhzAC+-EgGiCLWMAAIAEoYADuABUcp42ABJWAQLEAXixwAAOlAsVi4GxkFj7KYoAheIzmVBnNh2Zz0jy+VjjJREiQSHBoCR2fSQPB8tglYykQBuRmMzHYLEAWXSZm4uFoAFFFhANGw8USSaxyZSaXTxYkoCbhharTb2ZtZOLWcKpKLeUysYI0aKAMq5bDmdnAINYpU5PBEJUo8WS6Wy+XsgCsGu1UF1ayxxNJFJgVNpdsrjurVIAPobjREvZa0Sl6w72E2S4yYAtlHKmf8JE2ABQSPtOmvshv9ykASld4eZcBgWJnc6bVndnrNXetKTXDI3zKvthIEFKViICF3VcpVkj1pjcfMK-FV+v8rvbAHwgJ9ZxfGsrBzBE8zsLEACosQARgABh-S8kQjKp1z-P8b0A4DQL3V93zYT802-X8cLw+9H2fRtXygmUxxIeCkNQyikQ1RkYhAVUgTHIJ8mQqwACYROExCQCRIA

Test Plan: Unit tests still pass, should make subsequent refactoring simpler.

Reviewers: ashoat, ginsu, tomek, rohan

Reviewed By: ashoat

Subscribers: wyilio

Differential Revision: https://phab.comm.dev/D9766