issue: https://linear.app/comm/issue/ENG-6299/save-new-keyserver-on-set-new-session
We want to save a keyserver if it was not present in the store, but it sent us a valid session
Details
Checked that if a keyserver was not present in the store before, but we dispatch an action that sets a new session for it, it is correctly added with all its fields
Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
There is an issue on web, because sessionID is being set before this code adds the keyserver to the store. So here previousEntry is truthy, but contains only sessionID, which causes errors down the line
This feels pretty hacky. We should know the urlPrefix before we make the very first call to a keyserver... otherwise, we wouldn't know how to query the keyserver. Can we instead introduce an action that gets dispatched before we call eg. getVersion?
I'm also a bit confused why this is necessary even with the other changes in the stack around temporarily_connected. Couldn't we simply avoid mutating the KeyserverStore in this case, and wait until we log in to populate the KeyserverStore?
We do know the urlPrefix, we don't know the id. So we don't have an entry for this keyserver in the store, because the store is keyed with the id. Adding an action before getVersion won't help, because we have no way of finding the keyservers id before we call it.
Our logic was that it could be useful to use the cookie the keyserver returns us in response to getVersion/verifyInviteLink in the next request. So we wanted to store this sessionChange
Our logic was that it could be useful to use the cookie the keyserver returns us in response
This doesn't seem important to me. Shouldn't we be deleting these "anonymous" cookies anyways? I'm not sure what purpose they serve anymore...