Page MenuHomePhabricator

[web] Handle relationship update errors
ClosedPublic

Authored by tomek on Jun 21 2022, 10:38 AM.
Tags
None
Referenced Files
F2906053: D4315.diff
Sun, Oct 6, 8:57 AM
Unknown Object (File)
Thu, Sep 26, 10:58 PM
Unknown Object (File)
Tue, Sep 24, 5:57 PM
Unknown Object (File)
Wed, Sep 11, 8:41 AM
Unknown Object (File)
Wed, Sep 11, 8:41 AM
Unknown Object (File)
Wed, Sep 11, 8:40 AM
Unknown Object (File)
Wed, Sep 11, 8:37 AM
Unknown Object (File)
Aug 25 2024, 9:37 PM

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.