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, Nov 1, 12:27 AM
Unknown Object (File)
Fri, Nov 1, 12:27 AM
Unknown Object (File)
Fri, Nov 1, 12:27 AM
Unknown Object (File)
Fri, Nov 1, 12:27 AM
Unknown Object (File)
Fri, Nov 1, 12:27 AM
Unknown Object (File)
Fri, Oct 18, 12:53 AM
Unknown Object (File)
Fri, Oct 18, 12:53 AM
Unknown Object (File)
Fri, Oct 18, 12:53 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
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