matrix-org / matrix-org/matrix-hookshot

Set displayname for bot user with homeserver setting "enable_set_displayname: false"

Open
#783 2 comments 0 reactions 0 assignees View on GitHub
S-Major X-Needs-Info
Dominant language
TypeScript
Stars
450
Forks
95
Avg merge
1d 2h
Merged PRs (30d)
23

Description

Is it a configuration failure or a bug?

I want to set "enable_set_displayname: false" in the homeserver's configuration. When I try to create a new webhook I get the following error message because the bot user's display name cannot be set:

2023-06-16T12:27:16.556698424+02:00 ERROR 10:27:16:556 [MatrixHttpClient] (REQ-139) {
2023-06-16T12:27:16.556763834+02:00 errcode: 'M_FORBIDDEN',
2023-06-16T12:27:16.556787107+02:00 error: 'Changing display name is disabled on this server'
2023-06-16T12:27:16.556815351+02:00 }
2023-06-16T12:27:16.558166053+02:00 WARN 10:27:16:556 [Bridge] Failed to handle generic webhook MatrixError: M_FORBIDDEN: Changing display name is disabled on this server
2023-06-16T12:27:16.558231443+02:00 at doHttpRequest (/bin/matrix-hookshot/node_modules/matrix-bot-sdk/lib/http.js:95:15)
2023-06-16T12:27:16.558246972+02:00 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2023-06-16T12:27:16.558276541+02:00 at async descriptor.value (/bin/matrix-hookshot/node_modules/matrix-bot-sdk/lib/metrics/decorators.js:19:32)
2023-06-16T12:27:16.558290686+02:00 at async descriptor.value (/bin/matrix-hookshot/node_modules/matrix-bot-sdk/lib/metrics/decorators.js:19:32)
2023-06-16T12:27:16.558305885+02:00 at async GenericHookConnection.ensureDisplayname (/bin/matrix-hookshot/Connections/GenericHook.js:187:13)
2023-06-16T12:27:16.558318895+02:00 at async GenericHookConnection.onGenericHook (/bin/matrix-hookshot/Connections/GenericHook.js:307:9)
2023-06-16T12:27:16.558331307+02:00 at async /bin/matrix-hookshot/Bridge.js:402:25
2023-06-16T12:27:16.558343985+02:00 at async Promise.all (index 0)
2023-06-16T12:27:16.558358884+02:00 at async LocalMQ. (/bin/matrix-hookshot/Bridge.js:383:13) {
2023-06-16T12:27:16.558371440+02:00 body: {
2023-06-16T12:27:16.558383698+02:00 errcode: 'M_FORBIDDEN',
2023-06-16T12:27:16.558396354+02:00 error: 'Changing display name is disabled on this server'
2023-06-16T12:27:16.558409011+02:00 },
2023-06-16T12:27:16.558420096+02:00 statusCode: 400,
2023-06-16T12:27:16.558432083+02:00 errcode: 'M_FORBIDDEN',
2023-06-16T12:27:16.558443087+02:00 error: 'Changing display name is disabled on this server',
2023-06-16T12:27:16.558454364+02:00 retryAfterMs: undefined
2023-06-16T12:27:16.558465130+02:00 }

Is it possible to change this behavior?

Contributor guide

Open the contributing guide

Research direction

Start in Connections/GenericHook.js at ensureDisplayname, identified in the stack trace around line 187, and trace its call from onGenericHook. Reproduce webhook creation with the homeserver setting enable_set_displayname: false and inspect the existing tests for generic webhooks. Done means webhook creation no longer fails because the bot display name cannot be changed.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, typescript
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.