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

feat: remove side effect from the deprecated error context augmentation #2069

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

barjin
Copy link
Contributor

@barjin barjin commented Sep 7, 2023

Following the trend of removing side-effects from the Crawlee codebase, this one looks pretty unintentional - the augmented context is passed to a handler, but the changes persist even after the handler is executed.

Fixes #2068

@barjin barjin force-pushed the fix/error-context-aug branch from 419d225 to b766d81 Compare September 7, 2023 13:46
@barjin
Copy link
Contributor Author

barjin commented Sep 7, 2023

Due to the failing tests, I had to update the tests suites a bit (remove the equality test since the base context and the context passed to failedRequestHandler are not the same object anymore).

While the other tests are passing, it makes me think - is spread copy enough in this case?

@barjin barjin force-pushed the fix/error-context-aug branch from b766d81 to 7fb05a8 Compare September 7, 2023 14:05
@barjin barjin merged commit f9fb5c4 into master Sep 8, 2023
8 checks passed
@barjin barjin deleted the fix/error-context-aug branch September 8, 2023 11:59
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.

TypeError: Cannot redefine property 'error'
2 participants