-
Notifications
You must be signed in to change notification settings - Fork 429
Bug: Router context not being available when using AppSync with async resolvers #5290
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
Comments
Thanks for opening your first issue here! We'll come back to you as soon as we can. |
Hey @bjorger! Thanks for opening this bug. I was able to reproduce this error and I can confirm this is a bug. The problem is because we need to clean the context after the execution to prevent it from remaining in memory on the next run, but it looks like we have a problem with coroutines because it is being cleaned up before the coroutine runs. I'm adding this to the backlog to investigate more this or next week. If you have time and found a solution before me, I'd love you submit a PR to fix this. |
Hi @bjorger! I spent some time today investigating this issue and I don't know if we can fix it without a refactoring that will be a breaking change for our customers. The problem here is because we have no control over the evenloop or tasks that will be scheduled by To be honest I think this is an error in our implementation, we should have control over the async execution and execute it inside the But I have an alternative for this. Not the best developer experience, but it solves the problem and we can refactor this in v4. 1 - I will check if the I'm still open to hearing other opinions/ideas to fix this, but if we don't have any, what do you think of this solution? Thanks |
|
This is now released under 3.3.0 version! |
Expected Behaviour
When accessing the router.context in a resolver, with async resolvers, it should not be an empty dict, but much rather expose the context injected with app.append_context
Current Behaviour
When using router.context in async resolvers, the router.context is an empty dict
Code snippet
Possible Solution
No response
Steps to Reproduce
Just plug in the lambda_handler and mutation I attached above, deploy it and run the mutation via the AppSync console
Powertools for AWS Lambda (Python) version
latest
AWS Lambda function runtime
3.8
Packaging format used
Lambda Layers
Debugging logs
No response
The text was updated successfully, but these errors were encountered: