fix: fall back from api_server deliver=origin to home channels (#69304) - #69436
Closed
aurorabotticus-svg wants to merge 1 commit into
Closed
fix: fall back from api_server deliver=origin to home channels (#69304)#69436aurorabotticus-svg wants to merge 1 commit into
aurorabotticus-svg wants to merge 1 commit into
Conversation
Collaborator
Related: #69350 preserves origin delivery through a request-scoped delivery-platform hint, while #69384 adds generalized undeliverable-origin validation and creation-time notices. This PR applies only the api_server home-channel fallback; a maintainer should choose the policy. |
Author
|
Closing — duplicate of existing PR. Apologies for the noise. |
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.
Fixes #69304
Problem
When a cron job is created from an
api_serversession withdeliver=origin, the origin resolves to{platform: "api_server", chat_id: ...}. Butapi_serveris request/response only — it has nosend()adapter. The job runs and succeeds (last_status: ok) but delivery silently fails withAPI server uses HTTP request/response, not send().This is invisible to the creator — they scheduled a job and nothing ever comes back.
Fix
In
_resolve_single_delivery_target(), detect whendeliver=originresolves toapi_serverplatform and log a clear warning, then fall through to the home-channel fallback (which already exists for jobs with no origin at all):The fallback path (
for platform_name in _iter_home_target_platforms()) then picks up a deliverable platform.Verification
py_compilepasses