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

Avoid JSON encoding event payloads more than once #628

Merged
merged 2 commits into from
Jul 5, 2021

Conversation

imjoehaines
Copy link
Contributor

Goal

Currently we JSON encode payloads three times:

  1. once to check the payload size
  2. once to re-check the payload size after possibly removing metadata — this is unconditional so happens even if the payload is already small enough
  3. once using Guzzle's json option

This PR ensures that we only JSON encode payloads once when possible. If a payload is too large to send after encoding, we will still do a second encode after removing metadata

@imjoehaines imjoehaines marked this pull request as ready for review July 1, 2021 14:54
@imjoehaines imjoehaines requested a review from kattrali July 1, 2021 14:54
@imjoehaines imjoehaines merged commit ba2f385 into next Jul 5, 2021
@imjoehaines imjoehaines deleted the fix-multiple-json-encodes branch July 5, 2021 09:30
@imjoehaines imjoehaines mentioned this pull request Sep 9, 2021
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