Skip to content

Restore the outer profiler context after a nested request on the same thread - #667

Open
SAY-5 wants to merge 1 commit into
MiniProfiler:masterfrom
SAY-5:fix-nested-request-context
Open

SAY-5 wants to merge 1 commit into
MiniProfiler:masterfrom
SAY-5:fix-nested-request-context

Conversation

@SAY-5

@SAY-5 SAY-5 commented Oct 18, 2026

Copy link
Copy Markdown

Fixes #666.

When the app issues a request through the same middleware on the same thread (for example with Rack::Test::Session), the inner call cleared the thread local context in its ensure block and the outer request then crashed at current.discard with NoMethodError. call now remembers the context it found on entry and restores that instead of nil.

… thread

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
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.

undefined method 'discard' for nil (NoMethodError) after Rack::Test::Session get request

1 participant