Skip to content

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

Closed
ojongerius wants to merge 1 commit into
aws-powertools:developfrom
ojongerius:address_event_mutation_alternate_take
Closed

fix(idempotency): compute hashes once to guard against inadvert mutat…#1094
ojongerius wants to merge 1 commit into
aws-powertools:developfrom
ojongerius:address_event_mutation_alternate_take

Conversation

@ojongerius

@ojongerius ojongerius commented Apr 6, 2022

Copy link
Copy Markdown
Contributor

…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
Copy Markdown
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
Copy Markdown
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