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)
Wed, Nov 13, 10:31 PM
Unknown Object (File)
Wed, Nov 13, 10:31 PM
Unknown Object (File)
Wed, Nov 13, 10:30 PM
Unknown Object (File)
Wed, Nov 13, 10:30 PM
Unknown Object (File)
Wed, Nov 13, 10:30 PM
Unknown Object (File)
Wed, Nov 6, 1:24 PM
Unknown Object (File)
Tue, Nov 5, 9:36 PM
Unknown Object (File)
Tue, Nov 5, 7:31 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
No Lint Coverage
Unit
No Test Coverage

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