Page MenuHomePhabricator

[web] Handle relationship update errors
ClosedPublic

Authored by tomek on Jun 21 2022, 10:38 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 16, 5:17 PM
Unknown Object (File)
Sun, Dec 15, 4:49 PM
Unknown Object (File)
Tue, Dec 3, 8:54 PM
Unknown Object (File)
Sun, Dec 1, 7:38 PM
Unknown Object (File)
Sat, Nov 23, 3:04 PM
Unknown Object (File)
Nov 9 2024, 7:50 AM
Unknown Object (File)
Nov 8 2024, 6:42 PM
Unknown Object (File)
Oct 20 2024, 1:17 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
Branch
ENG-1142
Lint
No Lint Coverage
Unit
No Test Coverage

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

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

@atul's suggestion makes sense to me

web/settings/relationship/add-users-list.react.js
189–194

Addressed in D4364

This revision was automatically updated to reflect the committed changes.