Hydrogen makes invalid query for device keys when using guest user
Describe the bug
When you enter a world as a guest user, there's a request to the https://matrix.thirdroom.io/_matrix/client/r0/keys/query? which returns a 404. The stack trace below shows this stemming from PeerCall.handleNegotiation.
POST https://matrix.thirdroom.io/_matrix/client/r0/keys/query? 404
fetchRequest @ hydrogen.es.js:1107
_baseRequest @ hydrogen.es.js:9093
_authedRequest @ hydrogen.es.js:9116
_post @ hydrogen.es.js:9119
queryKeys @ hydrogen.es.js:9206
_doSend @ hydrogen.es.js:9946
_hsApiRequest @ hydrogen.es.js:9937
HomeServerApiWrapper.<computed> @ hydrogen.es.js:9910
deviceForId @ hydrogen.es.js:18959
await in deviceForId (async)
(anonymous) @ hydrogen.es.js:20921
run @ hydrogen.es.js:182
wrap @ hydrogen.es.js:94
encryptDeviceMessage @ hydrogen.es.js:20920
encryptDeviceMessage @ hydrogen.es.js:20329
Member.sendSignallingMessage @ hydrogen.es.js:20102
(anonymous) @ hydrogen.es.js:19994
run @ hydrogen.es.js:182
wrap @ hydrogen.es.js:94
sendSignallingMessage @ hydrogen.es.js:19993
handleNegotiation @ hydrogen.es.js:19490
await in handleNegotiation (async)
To Reproduce Steps to reproduce the behavior:
- Use a guest account
- Enter a world
- See the console for the error
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: macOS
- Browser: Chrome
- Version: 105
If possible, please always attach the hydrogen structured logs to bug reports :pray:
I'm personally not able to repro this on the terra world (joined through the alias, not sure it's public?). I imagine the was a m.call.member event for a device that had since signed out (or a user that removed their account), not sure it's related to being a guest account? What did the console report? An uncaught promise rejection? We might need to better handle this.
Looking at the code, it does look indeed like the 404 wouldn't be caught, which could cause other code paths to not be run (related to other call members, that do still exist). Will fix that.