Page MenuHomePhabricator

[lib] don't dispatch policy acknowledgment action when user is not logged in
ClosedPublic

Authored by kamil on Sep 28 2023, 8:27 AM.
Tags
None
Referenced Files
F2110819: D9320.id.diff
Tue, Jun 25, 9:09 PM
F2106764: D9320.id31612.diff
Tue, Jun 25, 8:43 AM
F2106763: D9320.id31530.diff
Tue, Jun 25, 8:43 AM
F2106741: D9320.id.diff
Tue, Jun 25, 8:42 AM
F2106702: D9320.diff
Tue, Jun 25, 8:38 AM
Unknown Object (File)
Sun, Jun 23, 6:48 AM
Unknown Object (File)
Wed, Jun 19, 8:49 PM
Unknown Object (File)
Wed, Jun 19, 8:49 PM
Subscribers

Details

Summary

Enhancement to previous diff.
Avoid dispatching forcePolicyAcknowledgmentActionType for not logged-in users.
Added also handling logout in policies reducer.

Depends on D9295

Test Plan

Logic:

  1. Make sure policies still work

The issue we want to fix:

  1. Revert diff D9295
  2. On the login screen call the keyserver endpoint which requires policies
  3. Check if an error was thrown on a keyserver
  4. Make sure the modal is not shown

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.Sep 29 2023, 1:38 AM
tomek added inline comments.
lib/utils/action-utils.js
268 ↗(On Diff #31530)

This is a different value than we use in e.g. user-selectors isLoggedIn. Is it ok to use it?

This revision is now accepted and ready to land.Oct 3 2023, 3:53 AM

Can you expand the test plan a little bit by e.g. checking that a modal doesn't show for logged-out users?

In D9320#274599, @tomek wrote:

Can you expand the test plan a little bit by e.g. checking that a modal doesn't show for logged-out users?

Yes, updated test plan

lib/utils/action-utils.js
268 ↗(On Diff #31530)

yes, we only care about the user being different than anonymous