Repository navigation
test(feishu): drop the stale never-iterated assertion on storage failure - #207000
Merged
Merged
Conversation
- #206815 made saveMediaStream read its source on entry so an early source failure rejects the save; the stream is then closed. - The test keeps its contract: rejects with the storage error, destroys the stream although destroy() throws, and the server sees the close.
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 28, 2026
…ure (openclaw#207000) ## Problem `extensions/feishu/src/media-download.test.ts` › "closes an acquired stream on storage failure even when teardown throws" fails on main: `expected "Mock" to not be called at all, but actually been called 1 times`. Every PR that changes `package.json` runs this lane, so each one needs a CI override. ## Root cause openclaw#206815 (`92a7a47e`, "keep the Gateway running when a WhatsApp attachment fails to decrypt") made the shared sink `saveMediaStream` (`src/media/store.ts:557-588`) start reading its source on entry, before directory and temp-file setup, so a hot source that fails early rejects the save instead of crashing the Gateway. Its body names Feishu as a caller that gets the same guarantee. When staging then fails, the sink closes the source. The Feishu test still asserted that the stream is never iterated when storage fails, which contradicts that intended contract. ## Fix Drop the stale "never iterated" assertion and its spy. The test keeps what it is about: on a storage failure the download rejects with the storage error, the stream is destroyed even though `destroy()` throws, and the server sees the connection close. No production change. ## Impact Contributors only. The extension lane no longer fails on main. ## Evidence - Main `2afe305c`: 1 failed / 1 (`iterate` called once). - This branch: 1 passed / 1. - Adversarial review: the remaining assertions still catch the failure the test exists for. Remove `teardownSource()` from the outer catch in `media-chunk-idle.ts` and `stream.destroyed` and the server close both fail; remove its try/catch and the rejection becomes the teardown error. - Local review on this head: patch is correct, 0 findings. Co-authored-by: Ayaan Zaidi <[email protected]>
tideclaw-bot
pushed a commit
that referenced
this pull request
Nov 28, 2026
Adapt upstream #207000 (09d25c4) for the release. The shared sink starts iterating hot input before staging after #206815. Replace the obsolete no-iteration expectation with an explicit teardown-attempt assertion, retaining the storage-error identity, destroyed stream, and socket-close checks. Co-authored-by: RomneyDa <[email protected]>
tideclaw-bot
pushed a commit
that referenced
this pull request
Nov 28, 2026
…ure (#207000) ## Problem `extensions/feishu/src/media-download.test.ts` › "closes an acquired stream on storage failure even when teardown throws" fails on main: `expected "Mock" to not be called at all, but actually been called 1 times`. Every PR that changes `package.json` runs this lane, so each one needs a CI override. ## Root cause #206815 (`d1a11af0`, "keep the Gateway running when a WhatsApp attachment fails to decrypt") made the shared sink `saveMediaStream` (`src/media/store.ts:557-588`) start reading its source on entry, before directory and temp-file setup, so a hot source that fails early rejects the save instead of crashing the Gateway. Its body names Feishu as a caller that gets the same guarantee. When staging then fails, the sink closes the source. The Feishu test still asserted that the stream is never iterated when storage fails, which contradicts that intended contract. ## Fix Drop the stale "never iterated" assertion and its spy. The test keeps what it is about: on a storage failure the download rejects with the storage error, the stream is destroyed even though `destroy()` throws, and the server sees the connection close. No production change. ## Impact Contributors only. The extension lane no longer fails on main. ## Evidence - Main `de4d1cc8`: 1 failed / 1 (`iterate` called once). - This branch: 1 passed / 1. - Adversarial review: the remaining assertions still catch the failure the test exists for. Remove `teardownSource()` from the outer catch in `media-chunk-idle.ts` and `stream.destroyed` and the server close both fail; remove its try/catch and the rejection becomes the teardown error. - Local review on this head: patch is correct, 0 findings. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 09d25c4) Release adaptation: None; source patch applied unchanged. Co-authored-by: RomneyDa <[email protected]>
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
extensions/feishu/src/media-download.test.ts› "closes an acquired stream on storage failure even when teardown throws" fails on main:expected "Mock" to not be called at all, but actually been called 1 times. Every PR that changespackage.jsonruns this lane, so each one needs a CI override.Root cause
#206815 (
d1a11af0, "keep the Gateway running when a WhatsApp attachment fails to decrypt") made the shared sinksaveMediaStream(src/media/store.ts:557-588) start reading its source on entry, before directory and temp-file setup, so a hot source that fails early rejects the save instead of crashing the Gateway. Its body names Feishu as a caller that gets the same guarantee. When staging then fails, the sink closes the source.The Feishu test still asserted that the stream is never iterated when storage fails, which contradicts that intended contract.
Fix
Drop the stale "never iterated" assertion and its spy. The test keeps what it is about: on a storage failure the download rejects with the storage error, the stream is destroyed even though
destroy()throws, and the server sees the connection close. No production change.Impact
Contributors only. The extension lane no longer fails on main.
Evidence
de4d1cc8: 1 failed / 1 (iteratecalled once).teardownSource()from the outer catch inmedia-chunk-idle.tsandstream.destroyedand the server close both fail; remove its try/catch and the rejection becomes the teardown error.