This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Fix stuck notification counts on small servers #13168
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix unread counts for users on small servers. Introduced in v1.62.0rc1. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,12 +146,12 @@ def _mark_read(stream: int, depth: int) -> None: | |
_assert_counts(0, 0) | ||
_inject_actions(1, PlAIN_NOTIF) | ||
_assert_counts(1, 0) | ||
_rotate(2) | ||
_rotate(1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test missed the off-by-one error as we rotated at a stream ordering not associated with an event, which is not how the code works in practice. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would this have been caught if this test didn't poke the guts of everything and created a real room and real events? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes :( (I want to fix that but not in a RC) |
||
_assert_counts(1, 0) | ||
|
||
_inject_actions(3, PlAIN_NOTIF) | ||
_assert_counts(2, 0) | ||
_rotate(4) | ||
_rotate(3) | ||
_assert_counts(2, 0) | ||
|
||
_inject_actions(5, PlAIN_NOTIF) | ||
|
@@ -162,7 +162,7 @@ def _mark_read(stream: int, depth: int) -> None: | |
_assert_counts(0, 0) | ||
|
||
_inject_actions(6, PlAIN_NOTIF) | ||
_rotate(7) | ||
_rotate(6) | ||
_assert_counts(1, 0) | ||
|
||
self.get_success( | ||
|
@@ -178,13 +178,13 @@ def _mark_read(stream: int, depth: int) -> None: | |
|
||
_inject_actions(8, HIGHLIGHT) | ||
_assert_counts(1, 1) | ||
_rotate(9) | ||
_rotate(8) | ||
_assert_counts(1, 1) | ||
|
||
# Check that adding another notification and rotating after highlight | ||
# works. | ||
_inject_actions(10, PlAIN_NOTIF) | ||
_rotate(11) | ||
_rotate(10) | ||
_assert_counts(2, 1) | ||
|
||
# Check that sending read receipts at different points results in the | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stream orderings are always queried by exclusive-inclusive bounds.