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
Unknown Object (File)
Sat, Nov 30, 3:25 PM
Unknown Object (File)
Fri, Nov 29, 2:27 PM
Unknown Object (File)
Nov 20 2024, 5:10 PM
Unknown Object (File)
Nov 20 2024, 5:10 PM
Unknown Object (File)
Nov 20 2024, 5:10 PM
Unknown Object (File)
Nov 20 2024, 5:08 PM
Unknown Object (File)
Nov 11 2024, 4:49 AM
Unknown Object (File)
Nov 7 2024, 4:41 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