v2.0.0-beta.0
Pre-release
Pre-release
Process
We've now merged our changes to depend on the MPS (matrix-protection-suite). We're in the process of beta
testing v2.0.0
and this is the first of those pre-releases.
This release notes page is likely incomplete and will be updated
as more changes are uncovered or summarised.
What's Changed
- Draupnir now uses MPS (matrix-protection-suite) to provide its core functionality.
- Draupnir no longer requests components of room state when applying various actions, which should lead to a huge noticeable difference to Draupnir's responsiveness.
- An optional
RoomStateBackingStore
has been added to improve startup time for instances that run against slow servers
(e.g. matrix.org). Checkout the config description for it here. - New protections
MemberBanSynchronisationProtection
,ServerBanSynchronisationProtection
,RedactionSynchronisationProtection
, andPolicyChangeNotification
.- These replace the core functionality for applying policies related to users, servers and redactions.
- They will be enabled by default when you upgrade.
config.disableServerACL
will disable theServerBanSynchronisationProtection
.- The
joins
,since
,default
,sync
,protections status
commands have all been removed for now. - The
DetectFederationLag
protection has been removed. - We have new contributing documentation.
Upgrade steps
There are no manual upgrade steps, the new protections are automatically enabled.
The only thing you should note is that if you notice that Draupnir is slow to startup, then you should enable the room state backing store
⚠️ Some configuration options may no longer be functioning (alternatives are pending)
config.noop
will do nothing.config.protectedRooms
will also do nothing, and protected rooms need to be configured using!draupnir rooms add/remove
.
Development Changes Summary
- MPS now parses events sourced from
/sync
, appservice push, and
other APIs for us, so no moreany
orunknown
. - MPS provides us with string types for
StringRoomID
,StringEventID
,
andStringUserID
. So no more mixing those up. - MPS provides us with an interface to immutable room state snapshots
with theRoomStateRevisionIssuer
andRoomStateRevision
. - MPS provides
PolicyRoomRevisionIssuer
,PolicyRoomRevision
,
RoomMembershipRevisionIssuer
, andRoomMembershipRevision
to
provide a convenient interface for listening to changes to
room membership and policy rules. - MPS provides protections with new hooks:
handleTimelineEvent
handlePolicyChange
handleMembershipChange
handleStateChange
handleEventReport
handleProtectionDisable
- Capability providers are introduced:
- Each capability has an interface.
- A
CapabilityProvider
constructs an instance, aCapability
,
that matches the matching capability interface.
- Protections now carry out their effects through instances of
Capability
:- Each
ProtectionDescription
describes a capability set with
their interfaces. - Each
ProtectionDescription
describes a default capability
provider to use to fulfill the prior interface. - When a
Protection
is instantiated, capability providers can be
swapped and replaced provided they match the same interface. - This means that you can extend or change the functionality
of protections without changing the code of the protections.
- Each
Internal Changes
- moved
MatrixEmitter
tomatrix-protection-suite-for-matrix-bot-sdk
and replaced with theSafeMatrixEmitter
- moved
ProtectedRoomsConfig
tomatrix-protection-suite
and has been interfaced away from Mjolnir's account data. - moved
ProtectedRoomsSet
has been moved tomatrix-protection-suite
and now provides the fundamental event source for protections. - deleted
RoomMembers
and has not been completely replaced. Inmatrix-protection-suite
there exists an alternative ofSetMembership
andRoomMembershipRevision
s.RoomMembers
would only load members that had joined since Mjolnir had started, membership revisions have all members.- There is no API for finding when a member first joined the room, since this is a lot more complicated to do and I don't know yet if that
is the right metric protections should use for finding if a user is new or not or participating.
- moved
AccessControlUnit
tomatrix-protection-suite
, it no longer acts as a cache for rules though,PolicyRoomRevision
s handle that instead. - moved
ListRule
tomatrix-protections-suite
asPolicyRule
. - deleted
PolicyList
. Has been replaced by distinct componentsPolicyRoomRevision
: An immutable snapshot of policies in a room.PolicyRoomRevisionIssuer
: CreatesPolicyRoomRevision
s as room state changes and emits events to notify listeners.PolicyRoomEditor
: Edits policies in a policy room.PolicyRoomManager
: Provides and builds the issuers and editors.
- deleted
PolicyListManager
. Has been replaced withPolicyListConfig
in thematrix-protection-suite
. - moved
ServerACL
tomatrix-protection-suite
, now called theServerACLBuilder
. - renamed
Mjolnir
toDraupnir
.- Draupnir has far fewer responsibilities than Mjolnir, we have and are continuing to move as much functionality as possible to protections.
- deleted
RuleServer
this was never used in production and we do not have access to the Synapse module it was written for, so it is impossible to maintain. - moved
RoomUpdateError
to thematrix-protection-suite
. - moved several interface manager components to MPS:
CommandError
andCommandException
are nowActionError
andActionException
.MatrixRoomReference
types are now sourced from thematrix-protection-suite
.- There are new string types for
StringUserID
,StringRoomID
andStringEventID
.
- deleted room directory commands
- 76a58b6
- It didn't seem like these ever worked with a Synapse admin API?
- deleted
joins
andsince
commands:joins
depended on the APIRoomMembers
provided and we do not have a replacement for finding the join time.- They did not work as intended because they could only provide information for joins that happened while Draupnir
was running. - If necessary, we could bring back an equivalent API that shows anyone with a top level membership of join
as a recent joiner.
- deleted
default
banlist command, as there is no place where we have a default list.- The implementation from Mjolnir stored this list as a "default shortcode" to find a list with, which is not great either.
- deleted
sync
command- As all functionality that the
sync
command effected has now been moved to protections,
the concept doesn't move across very well. There might be a replacement in future if it makes sense.
- As all functionality that the
- deleted
DetectFederationLag
this is a pretty huge protection 4b41541- It can be brought back in the future, there is not time to make it work and it never did work as intended.
- It is a shame because it was a bold piece of work.
- deleted
protections status <protection>
command. - ?
verify
permissions command may or may not be working? - moved all remaining commands to use the interface manager introduced in
v1.80.0
. - deleted Mjolnir's
ProtectionManager
as it has been made redundant in MPS. - replaced
consequences
. The same functionality is now provided byCapabilityProvider
s. - deleted
AppServiceBotEmitter
. No code uses emitters anymore. - added
DraupnirFactory
:- This uses
matrix-protetion-suite
'sClientsInRoomsMap
andRoomStateManagerFactory
to create Draupnir.
- This uses
- delted
MjolnirManager
:- Now depends on a
DraupnirManager
andAppserviceDraupnirManager
which have smaller and cleaner implementations.
- Now depends on a
- added
<span
> toDeadDocument
- enabled
Member/ServerBanSynchronisation
protections by default - added
RoomStateBackingStore
. - pass
config.disableServerACL
toServerBanSynchronisationProtection
- added
PolicyChangeNotificationProtection
Full Changelog: v1.87.0...v2.0.0-beta.0