HomePhabricator
Diffusion Comm c15f4bf08066

[lib] Don't require type parameter in mediaUpdate

Description

[lib] Don't require type parameter in mediaUpdate

Summary:
This diff fixes a bug on web where if you select an image for upload and immediately send the message, the message does not successfully send.

The bug was introduced in 46403debd4cd7d64552483f77d7956c3fadda65e. That diff expects mediaUpdate to always have a type parameter.

But we allow $Shape<Media> in UpdateMultimediaMessageMediaPayload, which means that a type parameter does not need to be set. We call it without type on web here. That's what causes the bug.

Turns out we don't need the invariant to avoid the Flow error. In fact I think Flow is missing a type error, but I don't think the work necessary to fix the types here is really worth it.

Test Plan: Make sure the bug is fixed

Reviewers: palys-swm

Reviewed By: palys-swm

Subscribers: KatPo, zrebcu411, Adrian

Differential Revision: https://phabricator.ashoat.com/D489

Details

Provenance
Ashoat Tevosyan <ashoat@gmail.com>Authored on Dec 4 2020, 6:47 PM
Reviewer
tomek
Differential Revision
Restricted Differential Revision
Parents
rCOMMe710fd8ffcf4: [server] Update to Node 15.3.0
Branches
Unknown
Tags
Unknown

Event Timeline