Summary
This patch release addresses bugs on Logger, Event Handler REST API, Idempotency, and a static type annotation on middleware factory utility.
We also updated our issues to use the new GitHub Issue Form, including a new Ask a Question, and Static typing mismatch report. The latter addresses an increase of bug reports that are better categorized as static typing mismatch - this will help us understand whether we might be able to support both Mypy and Pyright in the future.
Logger
Thanks to @eliasbrange, customers using clear_state=True
will no longer be affected by custom keys being accidentally removed in subsequent invocations - a regression introduced two releases ago. We improved tests on clear_state functionality.
Idempotency
Thanks to @ojongerius, customers changing the incoming event within the Lambda handler will no longer impact idempotency hash calculation. This was caused by Python's default pass by reference behaviour.
Event Handler REST API
Thanks to @sthuber90, customers receiving API calls that contain whitespace in path parameters - /customer/power tools
- will no longer return 404s. Despite API Gateway correctly decoding whitespace, our regex for safe and unsafe URI chars missed an explicit whitespace.
Middleware Factory
Thanks to @huonw, Mypy customers using --strict
mode will no longer complain about the return type of custom decorators using lambda_handler_decorator. It's a hard problem to solve considering our support for Python 3.6+. Later in the year, we'll look into the value-effort ratio of supporting strict
mode, and how to gradually bring typing_extensions
package across the board.
Huge thanks to new contributors: @sthuber90, @eliasbrange, and @ojongerius
Changes
🐛 Bug and hot fixes
- fix(api_gateway): allow whitespace in routes' path parameter (#1099) by @sthuber90
- fix(middleware_factory): ret type annotation for handler dec (#1066) by @huonw
- fix(logger): clear_state should keep custom key formats (#1095) by @eliasbrange
- fix(idempotency): pass by value on idem key to guard inadvertent mutations (#1090) by @ojongerius
This release was made possible by the following contributors:
@eliasbrange, @heitorlessa, @huonw, @mergify[bot], @ojongerius and @sthuber90