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
F3489836: D5827.diff
Wed, Dec 18, 1:49 PM
Unknown Object (File)
Sun, Dec 15, 8:30 PM
Unknown Object (File)
Sun, Dec 15, 8:30 PM
Unknown Object (File)
Sun, Dec 15, 8:30 PM
Unknown Object (File)
Sun, Dec 15, 8:29 PM
Unknown Object (File)
Sun, Dec 15, 8:20 PM
Unknown Object (File)
Sat, Dec 14, 11:36 PM
Unknown Object (File)
Thu, Nov 28, 7:28 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
Lint Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #19180)

I think this would be cleaner if it was indented less

tomek added inline comments.
lib/utils/call-server-endpoint.js
87–88 ↗(On Diff #19180)

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 ↗(On Diff #19180)

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 ↗(On Diff #19180)

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 ↗(On Diff #19180)

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