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
F2137248: D9320.diff
Fri, Jun 28, 5:18 PM
Unknown Object (File)
Wed, Jun 26, 3:58 PM
Unknown Object (File)
Tue, Jun 25, 9:48 PM
Unknown Object (File)
Tue, Jun 25, 9:09 PM
Unknown Object (File)
Tue, Jun 25, 8:43 AM
Unknown Object (File)
Tue, Jun 25, 8:43 AM
Unknown Object (File)
Tue, Jun 25, 8:42 AM
Unknown Object (File)
Tue, Jun 25, 8:38 AM
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
Branch
fix-prompt
Lint
No Lint Coverage
Unit
No Test Coverage

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

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

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