Page MenuHomePhabricator

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

Authored by atul on Sep 20 2022, 9:38 AM.
Tags
None
Referenced Files
F3345511: D5198.diff
Fri, Nov 22, 6:14 AM
Unknown Object (File)
Mon, Nov 11, 2:51 AM
Unknown Object (File)
Sat, Nov 2, 1:15 PM
Unknown Object (File)
Sat, Nov 2, 1:15 PM
Unknown Object (File)
Sat, Nov 2, 1:15 PM
Unknown Object (File)
Sat, Nov 2, 1:15 PM
Unknown Object (File)
Sat, Nov 2, 1:12 PM
Unknown Object (File)
Thu, Oct 24, 8:30 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
Branch
master
Lint
No Lint Coverage
Unit
No Test Coverage

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

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

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