Page MenuHomePhabricator

[native] implement onPressSave keyserver button callback
ClosedPublic

Authored by ginsu on Oct 31 2023, 9:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 28, 12:14 AM
Unknown Object (File)
Oct 5 2024, 6:06 PM
Unknown Object (File)
Oct 4 2024, 8:57 PM
Unknown Object (File)
Sep 28 2024, 3:23 AM
Unknown Object (File)
Sep 28 2024, 3:23 AM
Unknown Object (File)
Sep 28 2024, 3:23 AM
Unknown Object (File)
Sep 28 2024, 3:22 AM
Unknown Object (File)
Sep 28 2024, 3:22 AM
Subscribers

Details

Summary

This diff implements onPressSave keyserver button. This callback will create the payload necessary for this action and dispatch the add keyserver redux action we just introduced with the payload we just created. For now we will just use the current user id as the keyserver admin user id until ENG-5282 is done and returns a userID

In a subsequent diff we will implement validation that will be used before we introduce the keyserver

Linear task: https://linear.app/comm/issue/ENG-5338/dispatch-addkeyserver-redux-action

Depends on D9664

Test Plan

Please see the demo video below

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ginsu added reviewers: inka, rohan, michal.
ginsu requested review of this revision.Oct 31 2023, 9:52 PM
native/profile/add-keyserver.react.js
35–41 ↗(On Diff #32579)

Wouldn't it make sense to fill in the default values in the reducer?

native/profile/add-keyserver.react.js
35–41 ↗(On Diff #32579)

Why?

native/profile/add-keyserver.react.js
35–41 ↗(On Diff #32579)

To reduce the amount of data in the payload. Just as a memory optimisation. Since I expect we will always be using the default values for those fields in addKeyserver action

native/profile/add-keyserver.react.js
35–41 ↗(On Diff #32579)

I don't think we need to be concerned about the memory usage of this object. It appears to be very small

In general, we should focus on readability / simplicity unless there's a legitimate performance concern (eg. a performance impact that will affect the user)

Overoptimizing for performance by reducing 5 params to 2 or something is not really productive in my opinion

inka added inline comments.
native/profile/add-keyserver.react.js
35–41 ↗(On Diff #32579)

Okay, that's fair

This revision is now accepted and ready to land.Nov 7 2023, 6:35 AM

update after @inka's recently landed diffs

native/profile/add-keyserver.react.js
41

This was the only thing that I needed to update