Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Add the Notifications API #1028
Conversation
dbkr
added some commits
May 23, 2016
dbkr
assigned
erikjohnston
Aug 18, 2016
erikjohnston
commented on an outdated diff
Aug 18, 2016
synapse/rest/client/v2_alpha/notifications.py
| + notif_events[pa["event_id"]], | ||
| + self.clock.time_msec(), | ||
| + event_format=format_event_for_client_v2_without_room_id, | ||
| + ), | ||
| + } | ||
| + | ||
| + if pa["room_id"] not in receipts_by_room: | ||
| + returned_pa["read"] = False | ||
| + else: | ||
| + receipt = receipts_by_room[pa["room_id"]] | ||
| + | ||
| + returned_pa["read"] = ( | ||
| + receipt["topological_ordering"] >= pa["topological_ordering"] or ( | ||
| + receipt["topological_ordering"] == pa["topological_ordering"] and | ||
| + receipt["stream_ordering"] >= pa["stream_ordering"] | ||
| + ) |
|
|
erikjohnston
commented on an outdated diff
Aug 18, 2016
synapse/storage/receipts.py
| @@ -95,6 +95,31 @@ def get_receipts_for_user(self, user_id, receipt_type): | ||
| defer.returnValue({row["room_id"]: row["event_id"] for row in rows}) | ||
| @defer.inlineCallbacks | ||
| + def get_receipts_for_user_with_orderings(self, user_id, receipt_type): | ||
| + def f(txn): | ||
| + sql = ( | ||
| + "SELECT rl.room_id, rl.event_id," | ||
| + " e.topological_ordering, e.stream_ordering" | ||
| + " FROM receipts_linearized rl," | ||
| + " events e" | ||
| + " WHERE rl.room_id = e.room_id" |
erikjohnston
Owner
|
|
This looks OK to me, though am slightly scared by performance. I'm happy to merge this on the condition that we have a rethink if hitting this with @ara4n's account makes the server cry. |
dbkr
and others
added some commits
Aug 18, 2016
erikjohnston
merged commit d143f21
into
develop
Aug 22, 2016
10 checks passed
Flake8 + Packaging (Commit)
Build #1543 origin/dbkr/notifications_api succeeded in 41 sec
Details
Flake8 + Packaging (Merged PR)
Build finished.
Details
Sytest Dendron (Commit)
Build #633 origin/dbkr/notifications_api succeeded in 9 min 10 sec
Details
Sytest Dendron (Merged PR)
Build finished.
Details
Sytest Postgres (Commit)
Build #1462 origin/dbkr/notifications_api succeeded in 6 min 50 sec
Details
Sytest Postgres (Merged PR)
Build finished.
Details
Sytest SQLite (Commit)
Build #1506 origin/dbkr/notifications_api succeeded in 6 min 5 sec
Details
Sytest SQLite (Merged PR)
Build finished.
Details
Unit Tests (Commit)
Build #1578 origin/dbkr/notifications_api succeeded in 2 min 57 sec
Details
Unit Tests (Merged PR)
Build finished.
Details
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
dbkr commentedAug 18, 2016
Proposal: https://docs.google.com/document/d/1tQUOkbygHky_6Te4ZNCju_KV0Phmk1cuJsbf2Ir0Vvs/edit
Tests: matrix-org/sytest#236