Word mute limit calculation is inexact/unintuitive
What happened?
The wordMuteLimit
role limits the amount of text that users can input for word mutes based on the length of a JSON-stringified form of the generated word mute list, rather than the raw text itself. https://activitypub.software/TransFem-org/Sharkey/-/blob/develop/packages/backend/src/server/api/endpoints/i/update.ts#L314
This works as an approximate limit, but there is no clear documentation on how this limit behaves, and based on the above comment (TODO: ちゃんと数える
) seems to have been a quick hack meant to be changed later.
(Additionally, the default value of wordMuteLimit
is 200. This seems unnecessarily low, and I wonder if it was set this way by someone who expected "wordMuteLimit" to mean "limit to the number of words that can be muted"? I believe this default value could be made much higher, as there is no server-side cost to the word mutes other than storage space, which is negligible with any number of characters under a few hundred-thousand.)
What did you expect to happen?
Either for the limit to be based on the exact total number of characters, or for there to be documentation (or a clearer error message) explaining how/why the JSON-stringified limit works.
Version
2024.11.1-rc
Instance
Originally observed by @dispencer@mk.absturztau.be on mk.absturztau.be, then replicated on transfem.social, then in a local testing environment.
What type of issue is this?
Server-side
Contribution Guidelines
By submitting this issue, you agree to follow our Contribution Guidelines
- I agree to follow this project's Contribution Guidelines
- I have searched the issue tracker for similar issues, and this is not a duplicate.