Repository navigation
fix(gateway): keep pending /update completion notifications until the target platform reconnects - #38522
Closed
Frowtek wants to merge 1 commit into
Closed
fix(gateway): keep pending /update completion notifications until the target platform reconnects#38522Frowtek wants to merge 1 commit into
Frowtek wants to merge 1 commit into
Conversation
… target platform reconnects
Collaborator
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
When
/updatecompletes while the target messaging platform hasn't reconnectedyet (e.g. right after the restart
hermes updatetriggers), the gateway droppedthe completion markers without notifying the user — so the final "update
finished / failed" message was lost permanently, even after the platform came
back online.
The root cause was in
_send_update_notification(): when the update hadfinished but the adapter couldn't be resolved, the send was skipped yet the
finallyblock still deleted every marker file. This treats "adapter missing"as a definitive skip instead of a recoverable, deferred state.
Related Issue
Fixes #
Type of Change
Changes Made
gateway/run.py—_send_update_notification(): when the update is finishedbut the target adapter isn't connected, preserve the markers and defer
(return
False) instead of cleaning up. Markers are only removed once thenotification is actually delivered or the marker is genuinely undeliverable.
gateway/run.py—_watch_update_progress()completion-only fallback: keepretrying until delivery succeeds (or the deadline is hit) rather than giving
up after the first completion check, so a platform that reconnects shortly
after completion still gets notified in-process.
tests/gateway/test_update_command.py,tests/gateway/test_update_streaming.py— updated the contract test and added regression coverage for the
defer → reconnect → deliver flow (delivered exactly once, then cleaned up).
How to Test
/updatefrom a messaging platform and let it trigger a gateway restart.the originating chat (previously it was silently dropped).
Regression tests:
scripts/run_tests.sh tests/gateway/test_update_command.py tests/gateway/test_update_streaming.py tests/gateway/test_platform_reconnect.py -qChecklist
fix(gateway):)