Page MenuHomePhabricator

[lib] Create a selector that checks if a user is logged in to a keyserver
ClosedPublic

Authored by tomek on Jan 26 2024, 3:22 AM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 5 2024, 11:52 PM
Unknown Object (File)
Feb 26 2024, 1:18 AM
Unknown Object (File)
Feb 20 2024, 4:02 PM
Unknown Object (File)
Feb 20 2024, 2:07 PM
Unknown Object (File)
Feb 20 2024, 11:40 AM
Unknown Object (File)
Feb 20 2024, 11:39 AM
Unknown Object (File)
Feb 20 2024, 7:00 AM
Unknown Object (File)
Feb 17 2024, 9:22 PM
Subscribers

Details

Summary

Check if user is logged in and if the cookie exists and isn't anonymous.

Depends on D10814

Test Plan

Call a selector for keyserver with ashoatKeyserverID and check if it returns true. Add a new keyserver to the store and check if the selector returns false for it.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Delete unnecessary check - a dependency on dataLoaded flag makes this logic invalid

lib/selectors/user-selectors.js
175–177 ↗(On Diff #36150)

In the next diff you use this selector, and if it returns false you retry login.
But isLoggedIn returns false if dataLoaded is false. dataLoaded is only set to true once we connect to Ashoat's keyserver.
So if the client manages to login to some other keyserver, before they log in to Ashoat's keyserver, this selector will nevertheless return false, and the handler will retry login

I see you fixed this as I was writing the comment

This revision is now accepted and ready to land.Jan 26 2024, 5:51 AM