Preserve cross-app task routes across discovery loss#2369
Draft
3mdistal wants to merge 2 commits into
Draft
Conversation
Contributor
Visual recap — skippedThe visual recap job did not run for this pull request. This is informational only and does not block the PR. Recap skipped for |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
Problem
Cross-app
ask_appsubmissions can succeed while laterask_app_statuscalls lose the receiver. The status tool currently rediscovers the destination on every poll, so a cold start or temporary directory failure can turn a valid Content task into “No reachable ask_app task route.” Separately, standalone serverless bundles can identify themselves from the generated package name (traced-node-modules) instead of the configured app ID.For mutation-capable work, that ambiguity is dangerous: a caller may submit a replacement task even though the original still exists.
Approach
Use discovery only for the initial submission. When a durable task is accepted, return an encrypted, authenticated task handle that records the exact receiver route and task ID. Polling verifies that handle and reuses the recorded route without rediscovery.
The handle is routing metadata, not authorization. The receiver’s existing bearer authentication, task-owner check, and not-found behavior remain authoritative.
What changed
appIdauthoritative for standalonelist_appsidentity.ask_appsubmissions, bound to the serving app and authenticated caller identity.ask_app_statuspoll the recorded route across discovery loss while preserving legacy{ app, taskId }polling during migration.Safety and operations
Verification
Passed on commit
2a900855373c5202a511e3779cf1e83eeb8ad766:6a6273dd5e9dc200085c607aand Content preview6a6273ddf691d50007c2b924are ready at this commit.Still required before this PR is ready:
invalid_grant; the harness therefore could not authenticate the Calendar preview. No credential state was changed during this Work pass.Review focus
Follow-up boundary
This PR does not change async processor lifetime or Netlify background execution. A separate PR owns the observed five-minute caller timeout / stuck processor path.