Page MenuHomePhabricator

[lib] handle `policies_not_accepted` error on client
ClosedPublic

Authored by kamil on Dec 6 2022, 6:26 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jun 26, 12:22 PM
Unknown Object (File)
Wed, Jun 26, 11:19 AM
Unknown Object (File)
Mon, Jun 24, 2:12 AM
Unknown Object (File)
Tue, Jun 11, 8:09 PM
Unknown Object (File)
May 30 2024, 3:46 AM
Unknown Object (File)
May 30 2024, 1:59 AM
Unknown Object (File)
May 29 2024, 10:56 PM
Unknown Object (File)
May 29 2024, 10:56 PM
Subscribers

Details

Summary

Catch policies_not_accepted ServerError on both HTTP request and WebSocket call and dispatch redux action which containing information that policies needs to be acknowledged

Context in ENG-2363.

Test Plan

Connect to keyserver from account without accepted policies and check if action was properly dispatched after interaction with keyserver on both mobile/web (testing both HTTP and WebSocket connection).

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Dec 6 2022, 6:56 AM
lib/utils/call-server-endpoint.js
201–210

I think this would be cleaner if it was indented less

tomek added inline comments.
lib/utils/call-server-endpoint.js
87–88

options is optional parameter, so maybe it makes more sense to keep it as the last one so that we can skip it when calling this function.

201–210

These aren't equivalent. In the solution from the diff we're throwing for each error and not just for all but policies_not_accepted. But still, there are other ways of reducing the indentation.

This revision is now accepted and ready to land.Dec 9 2022, 10:03 AM

fix identation, make optional parameter last in function signature

lib/utils/call-server-endpoint.js
201–210

Not sure what you mean... I do think these are equivalent. But @kamil updated with my suggestion so I think we're good?

lib/utils/call-server-endpoint.js
201–210

Ah, you're right, sorry for the confusion. It seems like I missed a return