- Fix an issue where the provisioner API's
/v1/exchange_openid
route would sometimes fail. (#397)
- Add new
Provisioning and Widgets API
, so that bridges can provide richer integration APIs (#365, #388)
- Drop support for Node 12. Support Node 14+. (#382)
- Update typedoc to 0.22.9 (#377)
- Logging in as an appservice user (for encryption support) now uses
m.login.application_service
rather than the unstable prefix. This may break on homeservers that are not up to date with Matrix v1.2. (#389) - Replace Buildkite with GitHub Actions for CI. (#392)
- Add
bridge_app_version
metric, and utility functions to get the bridge app version. (#362)
- Do not retry membership queue operations after a 404 response. (#371)
-
Refactor Encryption broker code to use the bot-sdk, and generally be more race-resistant when starting new sessions.
Breaking: This change drops support for ephemeral events via the encryption broker, so ephemeral events MUST be enabled within the appservice registration to work. (#369)
-
Clarify help text of matrix_api_calls_failed metric (#372)
-
Update
matrix-appservice
to 0.10.0 (#374)
- Fix a bug where bridges could not register multiple user namespaces (#366)
- Fixed excessive logging (#364)
- Add optional UserActivityTracker for tracking & reporting monthly active users, and BridgeBlocker allowing for locking down the bridge communications (intended to be used together) (#350)
- Add tracking of last active Matrix users (previously maintained in https://github.com/Half-Shot/matrix-lastactive) (#594)
- Fix a bug that prevented bridges from calling
getPrometheusMetrics
without first callinglisten
inBridge
. (#355)
- The
StateLookup
class now takes anintent
rather than using a deprecatedMatrixClient
instance. (#357)
This release uses ^0.6.0-beta.2
in order to resolve an issue in @rocket.chat/forked-matrix-bot-sdk
with unusual registration namespaces.
This release introduces BREAKING changes. We are now using the @rocket.chat/forked-matrix-bot-sdk under the hood. While the library has kept the same function signatures in many places, some changes have been made. Please take care to review your bridge after upgrading to ensure that you do not depend on depecated or undefined behaviours.
Since 3.0.0 is a major release, there will be a release candidate process.
- Breaking: This library now uses the @rocket.chat/forked-matrix-bot-sdk for Matrix requests. Previously, the bridge used the matrix-js-sdk which
is now deprecated in this release, but can still be accessed via
Intent.getClient()
. (#326) - Breaking: The
Cli
will no longer specify a default port of8090
if one is not provided as an command line argument. insteadrun
will be called withnull
. Bridge developers MUST now handle this case. (#344) - Breaking The room link validator no longer has a seperate rule file. Bridge developers should maintain their own rules in the config file and call
updateRoomLinkValidatorRules
to update the ruleset on config reload. - Add
buckets
option to PrometheusMetrics.addTimer, to specify custom bucket intervals. (#347)
- Leave the new room on room upgrade if the upgrade was not successful. (#342)
- Remove unused
config
parameter fromBridge.run
. (#345)
- Export
matrix-appservice
classes and interfaces (#317) - Add
intent.ensureProfile
function. (#318) - Validate that the sender of a message edit matches the original sender. (#329)
- Renamed
MSC2364Content
interface toMSC2346
as the original name was a typo. (#322)
- The
master
branch forhttps://github.com/matrix-org/matrix-appservice-bridge
has been deleted. Projects should use the latest release/tag if currently depending onmaster
.develop
will continue to serve as the bleeding edge. (#320)
This is a important hotfix release to fix an issue where the room upgrade handling would not verify that the new room was a precessor of the old room. All bridges making use of the room upgrade handling feature should update.
- Fix an issue where the room upgrade handler would not check the
m.room.create
event when traversing an upgrade. (#330)
No significant changes.
- Add the
BridgeInfoStateSyncer
helper component to sync MSC2346 format state events to rooms. (#312)
- Ensure that the Intent room state cache is invalidate when the room state changes. (#310)
- Use
type=m.login.application
when registering appservice users, to comply with the spec. (#315)
- Upgrade matrix-appservice-node to 0.8.0 (#311)
No significant changes.
- Allow for returning
roomId
inonAliasQuery
which facilitates handling room creation yourself. (#288) - Allow the
Bridge
to be initalised without starting the HTTP listener. (#299) - Add
Intent.resolveRoom
function (#301)
- Fix a case where an encrypted bridge may stop syncing for some users of the bridge (#285)
- Fix onAliasQuery tests which would pass no matter if they failed (#289)
- Fix regex complexity vulnerability in highlight.js (GHSA-7wwv-vh3v-89cq) (#290)
- Fix a bug where /metrics would report empty values. (#296)
- Fix a bug that would cause membership queue request failures to not be reported under the
membershipqueue_reason
metric (#300) - Fix Winston logging errors if the bridge hadn't called Logger.configure yet (#302)
- Improve some TypeScript return types (#292)
- Update dependencies. We now use Typescript 4.1 which means that promiseutil.Defer now strictly checks resolve types. (#295)
- Update
matrix-js-sdk
to9.5.0
(#303) - Fetch metrics asynchronously (#304)
No significant changes.
- Fixed a issue the membership queue where a failed action would cause the
membershipqueue_pending
metric to increase. (#283)
- Add function
registerMetrics
toMembershipQueue
to track metrics. (#276) - Add
defaultTtl
option toMembershipQueue
to expire membership that is too old. (#277) - Logs from
matrix-js-sdk
will now be passed through the bridgeLogger
to keep logging in one place. (#280)
- Add a script to automatically generate documentation for a release. (#275)
- Fix a bug where
intent.uploadContent
would return the full JSON response of an upload rather than it's MXC url. (#279)
- Remove
winston-daily-rotate-file
side-effects which can throw errors with some installedwinston
versions (#264) - Fixed a bug where encrypted events may be handled twice. (#267)
- Update
matrix-appservice
dependency to 0.7.1 to fix a bug wheremsc2409.push_ephemeral
would be required in the registration file. (#270)
- Render various opts objects in the documentation that were missed last time (#268)
- Add contributing docs to make first time contributions easier (#269)
- Replace usages of deprecated
event.user_id
field withevent.sender
in examples. (#272)
- Remove travis-ci build status badge on README.md. (#273)
No significant changes.
- Fix issue where Intent.join would return undefined rather than the roomId (#257)
- Fix a bug where a timeout would not be cleared after a sucessful homeserver ping test (#256)
- Add
MembershipQueue
component (#251) - Add function to ping the homeserver to check that the AS can be reached (#253)
- Add
uploadContent()
, andsetRoomDirectoryVisibility()
intent functions (#254)
- Fix a bug where the default configuration would be overwritten on validation (#252)
- Fix a bug where messages would be echoed to the bridge from the bot user, even if
suppressEcho
was on. (#255)
No significant changes.
- Add a function to intent to set the user's profile in a room. (#248)
- Don't join the room when doing a self-kick (#250)
- Update matrix-js-sdk to v8.4.1 (#237)
- Add support for ephemeral events from the AS api (MSC2409) (#238)
- Return the roomId when calling intent.join (#241)
- Fix bug where OnAliasQuery would fail to fire if OnUserQuery was not defined (#247)
- Fix issue where ghost users would not be registered if they've never used the bridge (#249)
- Return
event_id
when sending a event or state event (#242)
- WeakEvent should allow for an optional
state_key
andunsigned
fields. (#236)
- Ensure that the bridge bot uses the real homeserver URL when encryption is enabled (#233)
- Add support for bridging encrypted events via matrix-org/pantalaimon. (#231)
Breaking changes since 1.0:
- Remove Bluebird Promise support. Promises returned by the library will now be native. (#216)
- Reinstate ability to call getProfileInfo without specifying a profile key. (#232)
- Bump matrix-js-sdk to 8.0.1 (#194)
- Use Typedoc over JSDoc for hosted documentation (#199)
- The bridge can now optionally reload the config file on a
SIGHUP
signal. Developers should define theonConfigChanged
callback when constructingCli
to make use of this feature. (#207) - Breaking: Remove Bluebird Promise support. Promises returned by the library will now be native. (#216)
- Make url parameter optional when generating registration. (#217)
- Add
Bridge.close
method to close the appservice (#227)
- Refactor RoomLinkValidator to not hastily approve a link if one user is exempt (#184)
- Fix bluebird defer warnings by using our own defer implementation. (#188)
- Bridge.run() now throws if it fails to listen to a port instead of creating a floating promise (#191)
- Fixed some broken typings and defer failures (#200)
- Fix issue where providing a custom Registry to getPrometheusMetrics would cause /metrics to emit no response (#201)
- Convert intent.js to TypeScript (#185)
- Convert
ClientFactory
to Typescript (#186) - Linter warnings no longer fail the linter, and
no-explicit-any
is a warning. (#187) - Port RequestFactory and Request to Typescript (#189)
- Remove some bluebird imports and use async/await in some tests (#190)
- Convert Cli to Typescript (#195)
- Remove
request
dependency (#197) - Typescriptify models/* (#202)
- Typescriptify MembershipCache (#203)
- Typescriptify ClientRequestCache (#204)
- Port Logging to Typescript. This change makes
winston
,winston-daily-rotate-file
andchalk
a required dependency. (#205) - Typescriptify ConfigValidator (#206)
- Breaking: Typescriptify the room, user and event stores. The stores will now return pure Promises (not Bluebird), which means code that relys on Bluebird features will break. (#208)
- Port RoomUpgradeHandler to Typescript (#209)
- Typescriptify BridgeContext (#210)
- Typescriptify bridge errors. The
wrap
function has been renamed towrapError
. (#211) - Typescriptify AppserviceBot (#212)
- Port the
Bridge
object to Typescript and remove javascript linting (#213) - Implement tweaks to typings to support existing bridges (#218)
- Upgrade internal tooling to use TypeScript 4 (#219)
- Types: Make some options of Cli optional Small corrections to HOWTO.md (#224)
- Types: Make some options of Bridge optional Add a project example: slack-starter (#225)
- Upgrade dependency: matrix-appservice (#226)
- Fix usages of private properties on
AppserviceRegistration
(#179)
- Update packages to latest versions (#175)
- Remove travis-ci configuration file (#176)
- Port
EventQueue
to Typescript. (#177) - Run NPM
build
onprepublish
. (#178)
- Drain log messages after configuring logging, not just on first message. Thanks @halkeye! (#150)
- Fix bug where
ContentRepo
is undefined due tomatrix-js-sdk
export changes. (#171)
- Make parsed CLI arguments accessible to bridges. Thanks @devec0! (#164)
- Use
towncrier
for changelog tracking (#168) - Allow bridges to provide their own prometheus metrics Register and disable the default metrics endpoint (#169)
- Fix prototype bug (#170)
- Fix a bug where Authorization headers were ignored for authenticated requests #162
- Fix an error which would break all custom bridge endpoints #161
- Remove usage of v1 event format keys in the library. #145
- The project now supports Typescript source files. #148
- StateLookup /state requests are now queued rather than run in parallel. #157
- IMPORTANT The bridge now supports authenticating
/_matrix/app/.../thirdparty
requests. #158 To remain backwards compatible with other homeservers, it is off by default. Settingopts.authenticateThirdpartyEndpoints
totrue
on theBridge
object will enable this behaviour. - Limit thirdparty requests to
v1
andunstable
versions. #160
- Update
HOWTO.md
to clarifyserver_name
/localhost
confusion. Thanks @marceltransier! #141 - Remove /appservice URL parth from
cli.js
help text. #152
- Minimum required Node.JS version is now 10. Thanks @V02460 #146
- Audit packages and update versions. #159
- Use
matrix-appservice
0.4.1
#138 - Bridges can now bind to a hostname rather than listening globally #137
- Add option to disable stores #135
- Ensure getJoinedMembers uses the roomId parameter
- Ensure getJoinedMembers returns it's promise
- Update matrix-js-sdk to 2.3.0 #134
- Fix issue where rejected promises would not be returned from _onEvent #133 #132
-
Bridge Errors are a new unstable feature which allows a bridge to report errors to the client when a message cannot be relayed. This feature is not stable and will be subject to change in the future. Please read the README for more information. #111, #121, #125, #127. Thanks to Kai (@V02460) for their work on this during GSOC!
-
Remove old room store entries during upgrade. #129, #130
- Bugfix where we failed to handle events with empty string
state_key
s
- Security fix Check that
state_key
exists on tombstone events.
- New
EventStore
component for storing matrix and remote event id mappings. #107 - Request.outcomeFrom no longer expects a Bluebird promise. #104
- Username escaping now handles
[ ]
#112 - Escaping can be now disabled by changing
MatrixUser.ESCAPE_DEFAULT
tofalse
. #112
- Linting has been fixed, and now supports more modern syntax. #110
- Fix issue where not supplying RoomUpgradeHandler would break incoming events
- Handle more cases of userid encoding
New RoomUpgradeHandler
component to handle room upgrades. More information on this can be found in the README.md.
- Fixed bug where the cli interface would incorrectly output to the log rather than to the console
- Fixed bug where invites and bans would be used to determine if a user "exists", which is not reliable.
- Bump matrix-js-sdk to 1.0.1
MatrixUser now escapes user ids by default which means any user id not conforming to https://matrix.org/docs/spec/appendices.html#user-identifiers will have some characters converted to QP encoding. This is likely to break some store mappings as well as create escaped ghost users where previously invalid ids would have been accepted.
User ids are now escaped when using MatrixUser
, see above.
Packages js-yaml
, matrix-appservice
, istanbul
have been updated.
jayschema
was removed in favour of is-my-json-valid
.
New component RoomLinkValidator
can now parse rule files for linking rooms
and abort a link that could potentially be problematic.
New component Logging
is a simple wrapper around winston
(which falls back
to console) for more straight forward log management.
See the README and docs for more information about these components.
Fix bug where age counters would overwrite it's parameter for periods.
Some Intent
operations now cache requests that would otherwise fall through
to the homeserver which can be expensive. This is configurable for Intent
s
via the opts.caching.ttl
and size
options.
AgeCounters now allow you to set your own time period buckets.
Added a new function Intent.getEvent
which will fetch events
from the homeserver without any context information, which should
be quick.
MembershipCache
is now exposed to let folks read and write to the cache
while also letting the bridge access it.
a
release: Fix issue where roomState
would fail.
b
release: Fix issue where we were calling this.intent inside intent like fools!
c
release: Fix issue where some stole js-sdk code was not checked thoroughly.
Updated matrix-js-sdk and matrix-appservice-node to latest versions.
The bridge now depends on prom-client.
When _ensureRegistered
fails, we now reject the Promise
with the error
unless the user is in use (M_USER_IN_USE
). This means that most intent
functions will reject if the user fails to be registered. This may break your
bridge, so please be aware of it.
Created and exposed the membership cache through MembershipCache
so
bridge developers may optionally setup the bridge any previous state they
may be aware of.
Membership is automatically passed to the MembershipCache
when getJoinedMembers
is called so that we don't needlessly join rooms. Registration is also cached now
so that we do not try to register users we are aware of through membership.
Deprecated getMemberLists
as it relied on /sync which is no longer allowed
in the client-server API for appservices. This will now throw an Error
instead.
Exposed isRemoteUser
(_isRemoteUser
is still present for backwards compat).
New setPresence
function on Intent for setting presence, can now disable presence
on the bridge via the bridge config.
Enable the default process-wide metrics in prom-client
a
release: Fixes enablePresence being off by default
Added dontJoin
option to Intent
class for use when the bridge is maintaining
its own membership state for each user.
Share data structures created by Intent
objects when accessed via the Bridge
class. This reduces memory usage and CPU usage as only 1 map needs to be updated
when new member/power level events are received, rather than N maps (where N is
the number of Intent
objects).
Cull Intent
objects which are accessed via Bridge.getIntent
after an eviction
period. This reduces memory usage.
a
release: Bugfixes whereby the bot Intent
could forget its state.
Allow the default SUCCESS/FAILED log lines to be turned off via opts.logRequestOutcome
.
Fixed a bug in the Intent
class which could cause message sending to fail
with M_FORBIDDEN
errors due to not being joined to the room. The class
now handles this case and will join the room before resending the message.
Specify a localTimeoutMs
of 2 minutes for every outbound HTTP request to
prevent connections from wedging if a response is never returned.
Added AppServiceBot
function getJoinedRooms
for getting a list of joined
room IDs for the AS bot and function getJoinedMembers
for getting a map of
joined user IDs for the given room ID. The values in the map are with a
display_name
and avatar_url
properties.
Switched the prometheus metrics from using the prometheus-client
library to
the prom-client
library.
Added PrometheusMetrics
functions addTimer
and startTimer
for manipulating
timer metrics for the bridge.
Bumped matrix-org/matrix-js-sdk dependency from 0.5.3
to 0.7.2
. See
the matrix-js-sdk changelog
Metrics.js has been refactored from matrix-appservice-{slack,gitter} to this repo. Bridge intent objects and Matrix client API calls are now counted as part of the new metrics functionality.
Added RoomBridgeStore
function removeEntriesByRemoteId
to remove entries in the DB with a given remote ID.
Added StateLookup
function untrackRoom
to stop further tracking of state events in a given room and delete existing stored state for it.
Use r0/sync
rather than v1/initialSync
for AppServiceBot
function getMemberLists
. A filter has also been added to limit the number events sent across.
Bump dependency on matrix-org/matrix-appservice-node from 0.3.1
to 0.3.3
. See the matrix-appservice-node changelog.
Third Party Lookup:
- 3PL/3PU lookups now return lists instead of individual results
- Reverse lookups now possible
Added Intent function sendReadReceipt
ContentRepo
now exported as pass-through from matrix-js-sdk
.
Improved queueing of pending messages to send to the homeserver to store one queue per destination room. This stops large amounts of traffic to a busy room from holding up traffic on other rooms.
Added a getProfileInfo
method on user intent objects to wrap the
corresponding matrix-js-sdk
client method.
Added a convenience in the bridge controller to wrap the new /thirdparty
API.
Increased the default dependency of the JS SDK to 0.5.3. This is to allow file uploads to work correctly.
Added new RoomBridgeStore
methods: getEntriesByLinkData
and
removeEntriesByLinkData
. See docs for function signatures and usage.
Added a new component: StateLookup
. Added a new Bridge
callback:
onAliasQueried(alias, roomId)
.
Added disableContext
option to the Bridge
class.
Modify the internal storage format of RoomBridgeStore
. Change the public API
of RoomBridgeStore
to reflect the new storage format.
This is a backwards-incompatible database format change. If you wish to upgrade from a 0.x version, you will need to write a script to upgrade your database.
The storage format has been changed to improve performance when querying room mappings.
Reduced the number of queries run when store methods are called. Added new
batch
functions to reduce database queries at the application level.
The bridge library will now use r0 /register
. Due to bugs inside Synapse, this
means the minimum supported Synapse version is 0.15.0-rc1 and above.
Fixed an issue where the bridge library would attempt to use v1 APIs on r0 paths.
This was caused by increasing the matrix-js-sdk
dependency which now defaults
to r0 paths. Fixed various matrix-js-sdk
breaking API changes such as the
change to the register()
function.
The bridge library still uses v1 /initialSync
.
Fixed a critical bug which would prevent the callback for HTTP requests from
firing if the request returned a network error such as ECONNRESET. This affected
all users of ClientFactory
who attached a logging function via setLogFunction
.
Increased the default matrix-js-sdk
dependency used by ClientFactory
to 0.4.1.
Improved JSDoc on various functions to clear up ambiguity. In addition:
Changes on the Intent
class:
- Fixed a bug which could cause
createRoom
to fail if theIntent
was scoped to the bot user. - Add intent option
dontCheckPowerLevel
to skip checking the required power level before sending events. - Added
getClient()
to retrieve the underlyingMatrixClient
instance. - Added
createAlias(alias, roomId)
.
Changes on the Bridge
class:
- Modified the default request error callback to always log 'FAILED'.
- Added
loadDatabases()
which can be invoked prior torun()
for bridge setup. - Expose
Intent
constructor options in the bridgeopts
.
Changes on the MatrixUser
class:
- Added
get(key)
andset(key, val)
to allow arbitrary data to be stored on Matrix users.
Changes on the RoomBridgeStore
class:
- Added
unlinkByData()
- Added the concept of "Link Keys" to clobber links based on something other than the tuple of the room IDs.
Changes on the UserBridgeStore
class:
- Added
getByMatrixData()
.
Dependency on matrix-appservice
was bumped to fix a critical bug.
BREAKING CHANGE : An id
field is required by all registration files as a result of bumping the dependency
of matrix-appservice
to 0.3.0
.
Added the following Bridge
function:
Bridge.getClientFactory()
Do not log values returned by resolved Requests
, only on errors.
Adjusted the promise returned by the event listener the Bridge
class attaches
to AppService
. This is mainly for testing purposes.
More functions/options have been added to the Cli
class:
enableLocalpart
: Settrue
to enable the--localpart [-l]
flag.- The CLI flag
--file [-f]
has been added. This represents the location of the registration file. - The
run()
function now includes the loadedAppServiceRegistration
instance as an argument.
Bug fixes on the Cli
class:
- When
generateRegistration
is called,this
is now bound to theCli
instance.
Implement the affectsRegistration
option on Cli
.
Added a HOW-TO.
Additions/improvements:
- Added a utility method
Bridge.getIntentFromLocalpart
. Intent
instances will now ensure that the user is registered.AppServiceRegistration
frommatrix-appservice
is now exported onmatrix-appservice-bridge
so end-developers don't need tonpm install matrix-appservice
.
Breaking changes:
- Changed the function signature of
Cli.generateRegistration
- the first arg is now anAppServiceRegistration
and not aString
.
- First release