element-hq / element-hq/synapse
Add a module API callback to override whether a given user is within the MAU trial period.
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
This issue has been migrated from [#12502](https://github.com/matrix-org/synapse/issues/12502).
---
[`is_trial_user`](https://github.com/matrix-org/synapse/blob/8af8a9bce5319ebf99573433f9f89d94767e173c/synapse/storage/databases/main/registration.py#L216-L231) is used to determine whether a given user is within the "trial period" for MAU. This is a grace period that means users who are active for less than N days are not counted as active users as far as MAU is concerned.
We've got a use case where specific users (as determined by their registration origin) will have different trial periods, so one way of achieving this would be a module callback to determine this.
Contributor guide
Research direction
Start in synapse/storage/databases/main/registration.py at is_trial_user, which currently determines whether a user is within the MAU trial period. Trace how that result is used and review the module API integration points before defining the callback behavior. Done means module-provided logic can determine the trial period for a user based on registration origin.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100