Skip to content

fix(idempotency): compute hashes once to guard against inadvert mutat… #1094

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

Conversation

ojongerius
Copy link
Contributor

@ojongerius ojongerius commented Apr 6, 2022

…ions

This protects against functions that inadvertently change the incoming event data

Alternate fix for #1093

Description of changes:

Calculate hashes once, this protects against event data being changed, but uses less system resources (memory by preventing a copy.deepcopy() and cpu by not recomputing hashes.

Checklist

Breaking change checklist

RFC issue #:

  • Migration process documented
  • Implement warnings (if it can live side by side)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…ions

This protects against functions that inadvertently change the incoming event data
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 6, 2022
@heitorlessa
Copy link
Contributor

Thanks again @ojongerius - Closing in favour of #1090, where it's less performant but easier to maintain (we're also changing private to public methods here)

@heitorlessa heitorlessa closed this Apr 6, 2022
@ojongerius
Copy link
Contributor Author

All good, it was just a sketch. As this modules evolves switching to computing once could be taken into account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants