summary refs log tree commit diff
path: root/synapse/storage/relations.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2022-03-30 11:45:32 -0400
committerGitHub <noreply@github.com>2022-03-30 11:45:32 -0400
commitc31c1091d4b591af0683e14363c5bf430b2f045e (patch)
tree60c53a63490bca0cad1180c674592a12cb2b36e8 /synapse/storage/relations.py
parentSend device list updates to application services (MSC3202) - part 1 (#11881) (diff)
downloadsynapse-c31c1091d4b591af0683e14363c5bf430b2f045e.tar.xz
Remove the unused and unstable `/aggregations` endpoint. (#12293)
This endpoint was removed from MSC2675 before it was approved.
It is currently unspecified (even in any MSCs) and therefore subject to
removal. It is not implemented by any known clients.

This also changes the bundled aggregation format for `m.annotation`,
which previously included pagination tokens for the `/aggregations`
endpoint, which are no longer useful.
Diffstat (limited to 'synapse/storage/relations.py')
-rw-r--r--synapse/storage/relations.py33
1 files changed, 1 insertions, 32 deletions
diff --git a/synapse/storage/relations.py b/synapse/storage/relations.py
index fba270150b..b9d2b46799 100644
--- a/synapse/storage/relations.py
+++ b/synapse/storage/relations.py
@@ -13,11 +13,10 @@
 # limitations under the License.
 
 import logging
-from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple
+from typing import TYPE_CHECKING, Any, Dict, List, Optional
 
 import attr
 
-from synapse.api.errors import SynapseError
 from synapse.types import JsonDict
 
 if TYPE_CHECKING:
@@ -52,33 +51,3 @@ class PaginationChunk:
             d["prev_batch"] = await self.prev_batch.to_string(store)
 
         return d
-
-
-@attr.s(frozen=True, slots=True, auto_attribs=True)
-class AggregationPaginationToken:
-    """Pagination token for relation aggregation pagination API.
-
-    As the results are order by count and then MAX(stream_ordering) of the
-    aggregation groups, we can just use them as our pagination token.
-
-    Attributes:
-        count: The count of relations in the boundary group.
-        stream: The MAX stream ordering in the boundary group.
-    """
-
-    count: int
-    stream: int
-
-    @staticmethod
-    def from_string(string: str) -> "AggregationPaginationToken":
-        try:
-            c, s = string.split("-")
-            return AggregationPaginationToken(int(c), int(s))
-        except ValueError:
-            raise SynapseError(400, "Invalid aggregation pagination token")
-
-    async def to_string(self, store: "DataStore") -> str:
-        return "%d-%d" % (self.count, self.stream)
-
-    def as_tuple(self) -> Tuple[Any, ...]:
-        return attr.astuple(self)