Page MenuHomePhabricator

[web] Handle relationship update errors
ClosedPublic

Authored by tomek on Jun 21 2022, 10:38 AM.
Tags
None
Referenced Files
F2212839: D4315.id.diff
Mon, Jul 8, 9:30 AM
Unknown Object (File)
Sat, Jul 6, 4:20 AM
Unknown Object (File)
Sat, Jul 6, 4:20 AM
Unknown Object (File)
Fri, Jul 5, 9:21 PM
Unknown Object (File)
Thu, Jul 4, 2:59 PM
Unknown Object (File)
Tue, Jul 2, 12:02 PM
Unknown Object (File)
Sun, Jun 30, 9:59 PM
Unknown Object (File)
Sun, Jun 30, 12:11 AM

Details

Summary

We should close the modal only after successful update. We can consider keeping the modal open and closing the tags, but we definitely must not close the modal before the response is received.

Depends on D4314

Test Plan

Modify relationship responder so that every second request succeeds. Select a user and click confirm button - the modal should remain open and the button should be disabled until the response is received. After the response, click the button again - the modal should get closed and the user should appear on friends list.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

(Reading through action-utils right now to better understand what's going on with dispatchActionPromise(...) and co ... adding @ashoat as a reviewer in the meanwhile if he gets to it first + it's probably good to get a second pair of eyes on it)

Looks good!

web/settings/relationship/add-users-list.react.js
189–194 ↗(On Diff #13634)

Should we do what we do (for example) in thread-settings-general-tab.react.js:changeThreadSettingsAction and wrap the call to callUpdateRelationships in a try/catch? Then we can gracefully display any errors and nudge to user to retry or whatever

This revision is now accepted and ready to land.Jun 21 2022, 8:57 PM

dispatchActionPromise use seems right to me

web/settings/relationship/add-users-list.react.js
189–194 ↗(On Diff #13634)

@atul's suggestion makes sense to me

web/settings/relationship/add-users-list.react.js
189–194 ↗(On Diff #13634)

Addressed in D4364

This revision was automatically updated to reflect the committed changes.