matrix-org / matrix-org/thirdroom
Hydrogen makes invalid query for device keys when using guest user
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 647
- Forks
- 70
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the guest-user flow by entering a world and inspect the request from PeerCall.handleNegotiation in hydrogen.es.js, especially the queryKeys call and its 404 response. Trace how the guest device key request is formed, then verify that entering a world no longer sends the invalid request or produces the reported error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api, authentication
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100