Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(request-queue): Limit payload size for batchAddRequests() #489

Merged
merged 3 commits into from Jan 8, 2024

Conversation

drobnikj
Copy link
Member

@drobnikj drobnikj commented Jan 5, 2024

Fixes #446

@github-actions github-actions bot added this to the 80th sprint - Platform team milestone Jan 5, 2024
@github-actions github-actions bot added t-platform Issues with this label are in the ownership of the platform team. tested Temporary label used only programatically for some analytics. labels Jan 5, 2024
@drobnikj
Copy link
Member Author

drobnikj commented Jan 5, 2024

Waititng for apify/apify-shared-js#431

test('batchAddRequests() chunks large payload', async () => {
const queueId = 'some-id';
const requestsLength = 30;
const longString = new Array(940000).fill('a').join('');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could've been "a".repeat(940_000)

src/utils.ts Outdated
for (const item of array) {
const itemByteSize = stringByteLength(JSON.stringify(item));
if (itemByteSize > maxByteLength) {
throw new Error(`RequestQueueClient.batchAddRequests: The size of the single request exceeds the maximum allowed size (${maxByteLength} bytes).`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it should include which item somewhere so the user knows, but I wouldn't block on it

@drobnikj drobnikj merged commit 164c9c7 into master Jan 8, 2024
6 checks passed
@drobnikj drobnikj deleted the feat/limit_batch_add branch January 8, 2024 12:21
@drobnikj drobnikj added the validated Issues that are resolved and their solutions fulfill the acceptance criteria. label Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t-platform Issues with this label are in the ownership of the platform team. tested Temporary label used only programatically for some analytics. validated Issues that are resolved and their solutions fulfill the acceptance criteria.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Limit payload for request queue batch add
3 participants