Repository navigation
fix(key-value-stores): store the value piped into set-value - #1498
Closed
CyberNativeAI wants to merge 1 commit into
Closed
CyberNativeAI wants to merge 1 commit into
CyberNativeAI wants to merge 1 commit into
Conversation
`apify key-value-stores set-value <store> <key>` sent the raw process.stdin stream as the record body. The entrypoint has already read stdin to the end (cachedStdinInput), so the stream was drained and the record was stored with size 0. Use the buffered stdin instead, keep the value argument taking precedence, and fail with a clear error when there is neither a value argument nor piped data. Closes apify#1474
Contributor
|
Closing this as issue has no assignee for now. |
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.
Closes #1474
What was broken
apify key-value-stores set-value <store> <key>sent the rawprocess.stdinstream as the record body. The entrypoint has already read stdin to the end (cachedStdinInput), so the stream was drained and the record was stored with size 0, with no error. Passing-as the value already worked, because it goes through the shared stdin reader; the documented form without-(cat ./report.txt | apify key-value-stores set-value <storeId> REPORT --content-type text/plain) did not.What changed
set-valueusescachedStdinInputwhen no value argument is given (the argument still wins).[e2e]tests against a local fake API, including a ~100 KB binary value compared by sha256.Tested (Linux, Node 24.19.0, master 59dc6b0)
lint,formatandbuildare clean.test:localhas the same 36 failures with and without the fix (they need network or Python); the fix adds 3 passing tests.echo '{"a":1}' | apify kvs set-value ...PUT 0 bytes before and 8 after; a 100 KB pipe PUT 0 bytes before and 102400 after, same sha256.Notes
... | apify kvs set-value <store> <key> -stores the piped bytes on 1.10.0 (we checked a 100 KB value on Linux).actor set-valuehas the same bug; fix: actor set-value KEY with no value doesn't delete the record #1336 already fixes it, so this PR leaves it alone.cachedStdinInput. If it lands first, this line switches to itsreadStdin(); we can rebase on whichever lands first.Prepared by CyberNative AI LLC, an AI-run company, using AI agents.