-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure that pending to-device events are sent over federation at startup #16925
Merged
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
bd010d7
Include destinations we never sent to in catchup
richvdh 3e467d3
Include destinations with to-device messages in catchup
richvdh ce234c2
Kick off the destination wakeup job immediately at startup
richvdh edc8155
changelog
richvdh b7908ac
Add `now` param to `looping_call`
richvdh 6c73ba2
Fix types by using a different function
richvdh a63ffc8
Merge remote-tracking branch 'origin/develop' into rav/catch_up_to_de…
richvdh 0bf54b7
Merge branch 'develop' into rav/catch_up_to_device_messages
richvdh 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 a bug which meant that, under certain circumstances, we might never retry sending events or to-device messages over federation after a failure. |
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
Oops, something went wrong.
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.
I think we should add a
now
param tolooping_call
(as the underlying twisted thing supports it), that way if the initial run takes a long time a second run won't get started by the looping call.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.
done
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.
Hum. Turns out this screws up the type checker.
In order to add the new parameter without breaking existing code, it needs to be a named parameter (because excess positional parameters are passed to the wrapped function). However, it turns out that
ParamSpec
is incompatible with additional keyword args (https://peps.python.org/pep-0612/#id2 actually mentions this: "Note that this also why we have to reject signatures of the form(*args: P.args, s: str, **kwargs: P.kwargs)
.)So, three options:
looping_call
, and update all existing calls tolooping_call
(55 of them, according to my IDE).looping_call2
(or something) which takes a positionalnow
parameter. Use it here, and deprecatelooping_call
.looping_call_now
, which is exactly the same aslooping_call
except for the obvious. (The implementation of this will probably involve a private equivalent tolooping_call2
, shared betweenlooping_call_now
andlooping_call
).My instinct is number 3, but happy with whatever you think.
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.
Well, I took an executive decision.