Skip to content

Conversation

@gasperzgonec
Copy link
Contributor

Description

This fix limits the max amount of bytes to be sent to SQS to be 200kB, which resolves the issue with the events being comitted to SQS and failing because they surpass the 250kB limit.

Connected Issues

Checklist

  • Tests added/updated and ran with npm run test OR no tests needed.
  • Ran backwards compatibility tests with npm run test:backwards-compatibility.
  • Tested airdrop-template linked to this PR.
  • Documentation updated and provided a link to PR / new docs OR no-docs written: no-docs

When the size reaches 80% of the 200KB size for the message, executes
the "onTimeout" function and returns the PROGRESS event.
Copy link
Collaborator

@radovanjorgic radovanjorgic left a comment

Choose a reason for hiding this comment

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

Few nits

import { ErrorRecord } from '../types/common';
import { EventData } from '../types/extraction';

const MAX_EVENT_SIZE = 200_000;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably it is a good practice to put the unit too, so MAX_EVENT_SIZE_BYTES? Or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are correct.
Fixed.

import { EventData } from '../types/extraction';

const MAX_EVENT_SIZE = 200_000;
const SIZE_LIMIT_THRESHOLD = Math.floor(MAX_EVENT_SIZE * 0.8); // 160_000 bytes
Copy link
Collaborator

Choose a reason for hiding this comment

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

EVENT_SIZE_THRESHOLD_BYTES

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants