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

fix: reduce batch size if API returns 413 #130

Merged
merged 5 commits into from
May 8, 2024
Merged

Conversation

marandaneto
Copy link
Member

@marandaneto marandaneto commented May 8, 2024

💡 Motivation and Context

Getting Flushing failed: PostHogApiError(statusCode=413, message=''). depending on the image size and batch size

💚 How did you test it?

Running and unit tests

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

@marandaneto marandaneto requested a review from a team May 8, 2024 06:56
Copy link
Member

@pauldambra pauldambra left a comment

Choose a reason for hiding this comment

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

👍

Comment on lines +334 to +335
config.maxBatchSize = calcFloor(config.maxBatchSize)
config.flushAt = calcFloor(config.flushAt)
Copy link
Member

Choose a reason for hiding this comment

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

nice... it makes me wonder how we'd know it was happening 🤔 but I guess we can figure out where we're returning 413 in capture and send an ingestion warning

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah we probably have 413s in our logging systems, adding one more custom event to the batch is likely to increase the payload :(

@marandaneto marandaneto merged commit b779a84 into main May 8, 2024
5 checks passed
@marandaneto marandaneto deleted the fix/screenshots-413 branch May 8, 2024 11:26
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.

2 participants