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
F3521411: D10830.id36252.diff
Mon, Dec 23, 3:27 AM
F3521410: D10830.id36157.diff
Mon, Dec 23, 3:27 AM
F3521409: D10830.id36150.diff
Mon, Dec 23, 3:27 AM
F3521394: D10830.id.diff
Mon, Dec 23, 3:27 AM
F3521386: D10830.diff
Mon, Dec 23, 3:26 AM
Unknown Object (File)
Tue, Nov 26, 8:05 AM
Unknown Object (File)
Nov 22 2024, 5:40 PM
Unknown Object (File)
Nov 22 2024, 1:45 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