fix(functions): honor pre-aborted signals with timeout - #2649
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughSummary by CodeRabbit
Walkthrough
Assessment against linked issues
Merge Risk: ⚪ Minimal · up to The change ensures already-aborted signals cancel invocations immediately when a timeout is configured while preserving existing request behavior; no actionable merge-blocking risk remains after normal checks and review. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔍 Description
What changed?
invoke()receives an already-aborted caller signal.FunctionsClient.invoke().Why was this change needed?
When both
timeoutandsignalare supplied,invoke()replaces the caller signal with a fresh controller and registers an abort listener. Registering that listener after the caller signal has already aborted does not replay the event, so the request could execute with an active signal.Closes #2648
📸 Screenshots/Examples
Not applicable.
🔄 Breaking changes
📋 Checklist
🧪 Validation
pnpm --dir packages/core/functions-js exec jest FunctionsClient.test.ts --runInBand— 3 passedpnpm nx test functions-js— 43 passed, 1 existing skippnpm nx build functions-js— passedpnpm exec prettier --check packages/core/functions-js/src/FunctionsClient.ts packages/core/functions-js/test/FunctionsClient.test.ts— passedgit diff --check— passedPackage-wide lint currently reports 12 pre-existing errors on the untouched base revision; targeted lint reproduces the same existing errors in
FunctionsClient.tsand reports no new test-file findings.