matrix-org / matrix-org/matrix-hookshot
Network failures can cause hookshot to fail to find account data
- Dominant language
- TypeScript
- Stars
- 450
- Forks
- 95
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 23
Description
```
WARN 12:10:31:588 [MatrixClient] Error getting uk.half-shot.matrix-hookshot.generic.hook room account data in !fibble:fobble: Error: socket hang up
at connResetException (node:internal/errors:705:14)
at TLSSocket.socketCloseListener (node:_http_client:467:25)
at TLSSocket.emit (node:events:525:35)
at node:net:301:12
at TCP.done (node:_tls_wrap:588:7) {
code: 'ECONNRESET'
}
WARN 12:10:31:589 [GenericHookConnection] hookId for !fibble:fobble not set in accountData, setting to fooble
```
We should write a safer method of fetching account data, perhaps with a retry mechanic.
`getSafeRoomAccountData` will return the default value if it fails to fetch account data *for any reason*, which is unsafe as it should only do so on 404.
Contributor guide
Research direction
Start by locating getSafeRoomAccountData and tracing how room account data is fetched and how errors are handled. Verify the behavior for network failures and 404 responses; done means non-404 failures cannot silently return the default value, with retry behavior added if appropriate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend, networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100