Page MenuHomePhabricator

[keyserver] Introduce `getMediaMessageServerDBContentsFromMedia(...)`
ClosedPublic

Authored by atul on Sep 20 2022, 9:38 AM.
Tags
None
Referenced Files
F1553417: D5198.id.diff
Tue, Apr 16, 9:15 AM
F1551634: D5198.id16993.diff
Mon, Apr 15, 9:36 PM
F1550470: D5198.id16921.diff
Mon, Apr 15, 3:58 PM
Unknown Object (File)
Mon, Apr 15, 1:54 AM
Unknown Object (File)
Mon, Apr 15, 12:57 AM
Unknown Object (File)
Mon, Apr 15, 12:05 AM
Unknown Object (File)
Sat, Apr 13, 1:26 AM
Unknown Object (File)
Thu, Apr 11, 12:16 AM
Subscribers

Details

Summary

Pull out common logic from multimedia-message-spec:messageContentForServerDB(...) and native/input-state-container:sendMultimediaMessageAction(...) and introduce helper function.

This is just a straightforward refactor to cut redundancy.


Depends on D5197

Test Plan

Set breakpoints and verified that values were as expected at each step.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul requested review of this revision.Sep 20 2022, 9:51 AM
ashoat added inline comments.
native/input/input-state-container.react.js
331 ↗(On Diff #16921)

This is weird... shouldn't Prettier limit to 80 chars?

If you format this in two lines, will Prettier force it back to one line?

This revision is now accepted and ready to land.Sep 21 2022, 7:04 AM

rebase before addressing feedback and before landing

remove type annotation for mediaMessageContents

native/input/input-state-container.react.js
331 ↗(On Diff #16921)

If you format this in two lines, will Prettier force it back to one line?

Yeah, I just ended up removing the type annotation which brought the line width to 75.


Guessing you've seen the following from the Prettier docs since this has come up a few times in the past:

Prettier’s printWidth option does not work the same way. It is not the hard upper allowed line length limit. It is a way to say to Prettier roughly how long you’d like lines to be. Prettier will make both shorter and longer lines, but generally strive to meet the specified printWidth.

(https://prettier.io/docs/en/options.html#print-width)

Usually I've seen that result in lines that are ~90ish lines long, 120ish seems way beyond "roughly" 80. Maybe prettier can't break apart $ReadOnlyArray<MediaMessageServerDBContent>? Just a hunch I have no idea