Commit da418b4c authored by Michał Polański's avatar Michał Polański Committed by Leo
Browse files

testing/dendrite: upgrade to 0.3.10

parent d41a2630
# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=dendrite
pkgver=0.3.9
pkgrel=1
pkgver=0.3.10
pkgrel=0
pkgdesc="Second-generation Matrix homeserver written in Go"
url="https://github.com/matrix-org/dendrite"
license="Apache-2.0"
arch="all !mips64" # limited by go
options="net" # required to download go modules
makedepends="go"
subpackages="$pkgname-openrc"
pkgusers="$pkgname"
......@@ -15,9 +16,7 @@ install="$pkgname.pre-install"
source="https://github.com/matrix-org/dendrite/archive/v$pkgver/dendrite-v$pkgver.tar.gz
dendrite.initd
dendrite.confd
ccf700f5c645f3f9a0de65d2431b47684ee79901.patch
"
options="net" # Required to download Go deps
build() {
for cmd in dendrite-monolith-server generate-keys create-account; do
......@@ -39,7 +38,6 @@ package() {
install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
}
sha512sums="9a1ae30647d4ce1d59a54530af54ff2bb1bc52a166170698b6ff547b5ee0d69a192dee5d8c74ca28722d717b9843c6cff22865818de69a45c8ef84e2168db2bf dendrite-v0.3.9.tar.gz
sha512sums="70b1597d16e136f7eeba2869d9a67fafb1628214567625af9792f5c88b85bc2a4237d56ba7604d9ce6fe78c1bafdc82b27e6f53903bfd7d0d9c15dabcf9070b9 dendrite-v0.3.10.tar.gz
92274e4f52eb0f35822d7f27279efd372b7959d8531ad7a247286727defc375ca4b4939ed7b82fa29061a0b3c923a6c41ac0f27f3cfd8acb9c96af72ffac333c dendrite.initd
a6a088683a6aebc431d3eb289bd0d4dbaede698d1a5da25d6af2aad79e9cd36db02ce9173ab6904249f23b88bca5d1630258736feef7e8266e6c22220d74fa1f dendrite.confd
d1821f45d6edce47b008da566832a95b3658cd6ddc5efd0f08c24b9dee1f9aa5d007cfe357ace36a6159a1bfb1e0c5bde116f5c6c221f16fbe03397b97b609b8 ccf700f5c645f3f9a0de65d2431b47684ee79901.patch"
a6a088683a6aebc431d3eb289bd0d4dbaede698d1a5da25d6af2aad79e9cd36db02ce9173ab6904249f23b88bca5d1630258736feef7e8266e6c22220d74fa1f dendrite.confd"
From ccf700f5c645f3f9a0de65d2431b47684ee79901 Mon Sep 17 00:00:00 2001
From: Neil Alexander <neilalexander@users.noreply.github.com>
Date: Fri, 5 Feb 2021 23:51:45 +0000
Subject: [PATCH] Fix nil pointer exception in membership updater
---
roomserver/internal/input/input_membership.go | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/roomserver/internal/input/input_membership.go b/roomserver/internal/input/input_membership.go
index bc646c3c6..b3fbb5dfc 100644
--- a/roomserver/internal/input/input_membership.go
+++ b/roomserver/internal/input/input_membership.go
@@ -106,6 +106,23 @@ func (r *Inputer) updateMembership(
// immediately, unless it's a Join update (e.g. profile update).
return updates, nil
}
+
+ // In an ideal world, we shouldn't ever have "add" be nil and "remove" be
+ // set, as this implies that we're deleting a state event without replacing
+ // it (a thing that ordinarily shouldn't happen in Matrix). However, state
+ // resets are sadly a thing occasionally and we have to account for that.
+ // Beforehand there used to be a check here which stopped dead if we hit
+ // this scenario, but that meant that the membership table got out of sync
+ // after a state reset, often thinking that the user was still joined to
+ // the room even though the room state said otherwise, and this would prevent
+ // the user from being able to attempt to rejoin the room without modifying
+ // the database. So instead what we'll do is we'll just update the membership
+ // table to say that the user is "leave" and we'll use the old event to
+ // avoid nil pointer exceptions on the code path that follows.
+ if add == nil {
+ add = remove
+ newMembership = gomatrixserverlib.Leave
+ }
mu, err := updater.MembershipUpdater(targetUserNID, r.isLocalTarget(add))
if err != nil {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment