Skip to content

docs(event-handler): update custom middleware example to use Store API#5145

Merged
dreamorosi merged 1 commit intomainfrom
fix/docs-custom-middleware-example
Mar 30, 2026
Merged

docs(event-handler): update custom middleware example to use Store API#5145
dreamorosi merged 1 commit intomainfrom
fix/docs-custom-middleware-example

Conversation

@svozza
Copy link
Copy Markdown
Contributor

@svozza svozza commented Mar 29, 2026

Summary

Changes

Replace the custom middleware example that used module-level mutable state with a correlation ID
middleware that uses the Store API (reqCtx.set/reqCtx.get). This demonstrates the recommended
pattern for managing per-request state in Lambda and avoids state leaking across warm invocations.

Issue number: closes #5103


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

@pull-request-size pull-request-size Bot added the size/M PR between 30-99 LOC label Mar 29, 2026
@svozza svozza force-pushed the fix/docs-custom-middleware-example branch 2 times, most recently from 411e319 to bd97aa8 Compare March 29, 2026 23:15
Replace module-level mutable state with the Store API (reqCtx.set/get) using
a correlation ID middleware example. This demonstrates the recommended pattern
for managing per-request state in Lambda.

Closes #5103
@svozza svozza force-pushed the fix/docs-custom-middleware-example branch from bd97aa8 to 0fc2c43 Compare March 29, 2026 23:17
@sonarqubecloud
Copy link
Copy Markdown

@svozza svozza requested a review from sdangol March 29, 2026 23:32
@dreamorosi dreamorosi merged commit 9e84323 into main Mar 30, 2026
50 checks passed
@dreamorosi dreamorosi deleted the fix/docs-custom-middleware-example branch March 30, 2026 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M PR between 30-99 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: event-handler middleware example uses unsafe module-level state for authentication

2 participants