matrix-org / matrix-org/matrix-hookshot

Why `requiredPl` is always requires `state_default`?

Open
#1,363 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

S-Minor T-Defect
Dominant language
TypeScript
Stars
450
Forks
95
Avg merge
1d 2h
Merged PRs (30d)
23

Description

The problem is because `state_default` is so general and could be better if `requiredPl` requires something concrete instead of `state_default`.

[There it is][search].

Currently I need following config to setup bot without messing with moderators or remapping other levels:
```jsonc
notifications.room: 20
state_default: 20 // why?!
content.events."uk.half-shot.matrix-hookshot.feed": 20
unsigned.events."uk.half-shot.matrix-hookshot.feed": 20
unsigned.users."@feeds:integrations.ems.host": 20
```

[search]: https://github.com/search?q=repo%3Amatrix-org%2Fmatrix-hookshot+%22state_default%22&type=code

- - -

> [spec](https://spec.matrix.org/v1.19/client-server-api/#mroompower_levels):
> Except for membership events and redactions, the level required to send a certain event is governed purely by events, state_default and events_default. If an event type is specified in events, then the user must have at least the level specified in order to send that event. If the event type is not supplied, it defaults to events_default for message events and state_default for state events.

For example `Feeds` sends only following types:
- `m.room.message`
- `uk.half-shot.matrix-hookshot.feed` (state)
- `io.element.integrations.installations` (state, setup, sent by user)

— There is no need to check `state_default` PL.

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

Start by tracing how requiredPl handles state_default and the configuration for Feeds. Compare that behavior with the listed event types and Matrix power-level rules; done means concrete event requirements no longer unnecessarily require state_default.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.