This will stop situations where the throttling queue was uninitialized in the Draupnir instances.
We should really enable `strict` for typescript.
The blocker for that is `useUnknownInCatchVariables` around legacy code (which should be minor).
And also `strictFunctionTypes`, which `interface-manager` exacerbates by not providing the right generics for `describeRenderer` and other methods.
https://github.com/the-draupnir-project/Draupnir/issues/496
* Update to @the-draupnir-project/interface-manager@2.0.0.
The interface has been changed in `interface-manager` so that we can't forget them.
Means that our little error renderer works again.
* Update to MPS v1.2.1.
This will allow us to use `describeProtectedRoomsSet` in unit tests.
* Update to @the-draupnir-project/interface-manager@1.1.1.
This allows for better type inference from the command and also for
partial keywords to be provided to commands as arguments.
* Unit test the DraupnirKickCommand.
Allow command executors to be unit tested.
Part of https://github.com/the-draupnir-project/planning/issues/22.
Only testing Watch/Unwatch command for now to prove that it works.
- Kick command will require a tiny MPS patch to expose kicking as a capability (I don't know if we're going to use the word Kick though).
- Kick command also will require the throttling queue to be hooked up and working again.
- Ban command should be pretty straight forward.
The name of the renderer needs to match the name of the associated capability. Otherwise when a protection asks for the capability you will get an obscure error about not being able to find a renderer for the cap.
* Fix the bot-sdk crypto by initializing the bot-sdk earlier
Signed-off-by: MTRNord <mtrnord1@gmail.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix formatting
Signed-off-by: MTRNord <mtrnord1@gmail.com>
* Instead of moving the sync start we move the one message causing issues. This makes sure we are actually ready for incoming messages
Signed-off-by: MTRNord <mtrnord1@gmail.com>
* Add a comment on why the startupComplete method is public
---------
Signed-off-by: MTRNord <mtrnord1@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
We split out some utility types from the matrix-protection-suite into a library https://github.com/the-draupnir-project/matrix-basic-types
I can't believe that like the extra lines from
```
import {
} from ...
```
are adding up so much but whatever.
* Move to @the-draupnir-project/basic-matrix-types.
* Whoopsie missed a test.
This protection allows room moderators to ban new users from servers (matrix.org). Existing users will be able to participate normally, and if they are accidentally banned, once unbanned rejoining will be unaffected.
This is intended to be used during periods of instability. The protection may be removed entirely or modified in a future release. We will add a documentation page shortly.
We have a lot of verbose headers, and i think now is the best opportunity we have to become reuse compliant given that we just did two other similar maintenance changes (prettier, typescirpt5 & eslint9 & typescript-eslint).
* synapse_antispam resuse headers.
* delete old unused tslint.json.
* Add REUSE to pre-commit config.
* reuse info for config directory.
This is probably going to be the best opportunity that we have to add and run prettier given that we just added typescript-eslint strict and we're coming out of a huge refactor.
* Migrate to eslint-9 strictTypeChecked & typescript 5.
* Update to MPS 0.23.0.
Required for strict type checks.
* Looks like we found a test that was complete garbage, amazing really.
* FIXUP
* Well, the command handler was bugged previously...
The command handler used to always only return the command
without the prefix due to an operator precedence bug.
This meant that when we made the order of operations explicit,
we were now including the prefix of the command in the copy.
So when we parsed arguments the code wasn't expecting the prefix
to be there.
* update to MPS 0.23.1.
MPS 0.23.0 was bugged because we didn't enable
`noUncheckedIndexedAccess` while upgrading to typescript 5.
* Make sure eslint runs on all ts files.
* eslint fixes.
* enable `noUncheckedIndexedAccess` & `exactOptionalPropertyTypes`.
* eslint ignores is clearly not understood by me.
* Update SuperCoolStream for eslint and ts5.
* stricter eslint done i thinks
* Whoops, added on .only somewhere.
* Update MPS.
* fix broken test realted things.
* Well I guess that part of getMessagesByUserIn was part of the interface.
* Fix redactionCommandTest.
* Account for escapeHTML in tests.
* Fix tests.
* stuff not matching with .editorconfig fixes.
* Fix appservice webAPI test.
* Update for MPS 0.23.3.
* feat: Add SBOM and Attestation to the Docker release process. Also ensure we only deploy platforms on the qemu action as needed and update versions.
This also limits the permissions used
* fix: Make sure there is an empty line at the end of the file
* Fix the qemu platforms
* Setup Yarn Classic through Corepack
* pre-commit: use corepack and silence warnings, add .eslintignore's
* .github/workflows/mjolnir.yml: use yarn through corepack
* mx-tester.yml: use corepack
* mx-tester.yml & package.json: replace references to npx and call corepack more
At least yarn build didn't break locally for me, so I think it's supported here too
* rm & gitignore .yarnrc
* mx-tester.yml & package.json: return to npx since yarn dlx doesn't exist in classic
Awesome.
The documentation was not very explicit, I had to play around
a lot to figure it out but I'm so happy that this works.
https://www.typescriptlang.org/docs/handbook/jsx.html.
Please note that `undefined` as a child will not be caught
yet, as we need to enable `exactOptionalPropertyTypes` for
this to work.