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)
Fri, May 31, 3:34 PM
Unknown Object (File)
Wed, May 22, 11:51 AM
Unknown Object (File)
Wed, May 22, 11:51 AM
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
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
Branch
handlers-2
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

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