mirror of
https://github.com/matrix-org/dendrite.git
synced 2024-11-30 10:11:56 -06:00
Merge branch 'master' into add-nats-support
This commit is contained in:
commit
4704957dab
20
CHANGES.md
20
CHANGES.md
|
@ -1,5 +1,25 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## Dendrite 0.4.1 (2021-07-26)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Support for room version 7 has been added
|
||||||
|
* Key notary support is now more complete, allowing Dendrite to be used as a notary server for looking up signing keys
|
||||||
|
* State resolution v2 performance has been optimised further by caching the create event, power levels and join rules in memory instead of parsing them repeatedly
|
||||||
|
* The media API now handles cases where the maximum file size is configured to be less than 0 for unlimited size
|
||||||
|
* The `initial_state` in a `/createRoom` request is now respected when creating a room
|
||||||
|
* Code paths for checking if servers are joined to rooms have been optimised significantly
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* A bug resulting in `cannot xref null state block with snapshot` during the new state storage migration has been fixed
|
||||||
|
* Invites are now retired correctly when rejecting an invite from a remote server which is no longer reachable
|
||||||
|
* The DNS cache `cache_lifetime` option is now handled correctly (contributed by [S7evinK](https://github.com/S7evinK))
|
||||||
|
* Invalid events in a room join response are now dropped correctly, rather than failing the entire join
|
||||||
|
* The `prev_state` of an event will no longer be populated incorrectly to the state of the current event
|
||||||
|
* Receiving an invite to an unsupported room version will now correctly return the `M_UNSUPPORTED_ROOM_VERSION` error code instead of `M_BAD_JSON` (contributed by [meenal06](https://github.com/meenal06))
|
||||||
|
|
||||||
## Dendrite 0.4.0 (2021-07-12)
|
## Dendrite 0.4.0 (2021-07-12)
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
|
@ -40,22 +40,29 @@ func InviteV2(
|
||||||
) util.JSONResponse {
|
) util.JSONResponse {
|
||||||
inviteReq := gomatrixserverlib.InviteV2Request{}
|
inviteReq := gomatrixserverlib.InviteV2Request{}
|
||||||
err := json.Unmarshal(request.Content(), &inviteReq)
|
err := json.Unmarshal(request.Content(), &inviteReq)
|
||||||
switch err.(type) {
|
switch e := err.(type) {
|
||||||
|
case gomatrixserverlib.UnsupportedRoomVersionError:
|
||||||
|
return util.JSONResponse{
|
||||||
|
Code: http.StatusBadRequest,
|
||||||
|
JSON: jsonerror.UnsupportedRoomVersion(
|
||||||
|
fmt.Sprintf("Room version %q is not supported by this server.", e.Version),
|
||||||
|
),
|
||||||
|
}
|
||||||
case gomatrixserverlib.BadJSONError:
|
case gomatrixserverlib.BadJSONError:
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusBadRequest,
|
Code: http.StatusBadRequest,
|
||||||
JSON: jsonerror.BadJSON(err.Error()),
|
JSON: jsonerror.BadJSON(err.Error()),
|
||||||
}
|
}
|
||||||
case nil:
|
case nil:
|
||||||
|
return processInvite(
|
||||||
|
httpReq.Context(), true, inviteReq.Event(), inviteReq.RoomVersion(), inviteReq.InviteRoomState(), roomID, eventID, cfg, rsAPI, keys,
|
||||||
|
)
|
||||||
default:
|
default:
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusBadRequest,
|
Code: http.StatusBadRequest,
|
||||||
JSON: jsonerror.NotJSON("The request body could not be decoded into an invite request. " + err.Error()),
|
JSON: jsonerror.NotJSON("The request body could not be decoded into an invite request. " + err.Error()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return processInvite(
|
|
||||||
httpReq.Context(), true, inviteReq.Event(), inviteReq.RoomVersion(), inviteReq.InviteRoomState(), roomID, eventID, cfg, rsAPI, keys,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// InviteV1 implements /_matrix/federation/v1/invite/{roomID}/{eventID}
|
// InviteV1 implements /_matrix/federation/v1/invite/{roomID}/{eventID}
|
||||||
|
|
|
@ -17,7 +17,7 @@ var build string
|
||||||
const (
|
const (
|
||||||
VersionMajor = 0
|
VersionMajor = 0
|
||||||
VersionMinor = 4
|
VersionMinor = 4
|
||||||
VersionPatch = 0
|
VersionPatch = 1
|
||||||
VersionTag = "" // example: "rc1"
|
VersionTag = "" // example: "rc1"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -174,6 +174,9 @@ func UpStateBlocksRefactor(tx *sql.Tx) error {
|
||||||
err = tx.QueryRow(
|
err = tx.QueryRow(
|
||||||
`SELECT event_nid FROM roomserver_events WHERE state_snapshot_nid = $1 AND event_type_nid = 1`, s.StateSnapshotNID,
|
`SELECT event_nid FROM roomserver_events WHERE state_snapshot_nid = $1 AND event_type_nid = 1`, s.StateSnapshotNID,
|
||||||
).Scan(&createEventNID)
|
).Scan(&createEventNID)
|
||||||
|
if err == sql.ErrNoRows {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("cannot xref null state block with snapshot %d: %s", s.StateSnapshotNID, err)
|
return fmt.Errorf("cannot xref null state block with snapshot %d: %s", s.StateSnapshotNID, err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue