matrix-org / matrix-org/thirdroom

Hydrogen makes invalid query for device keys when using guest user

Open
#304 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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:

  1. Use a guest account
  2. Enter a world
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.