question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

request.state is not persisted between middlewares.

See original GitHub issue

I am not finding my request.state.xyz = 1 on the next middleware execution. Bug?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
tomchristiecommented, Jun 15, 2019

As a side effect, that’d also resolve #545

1reaction
tomchristiecommented, Jun 15, 2019

Good point yup - it’s not being initialized based on what’s in the scope.

We should tweak things here, so that it has __getattr__, __setattr__, and __delattr__ methods, each of which actually get/set/delete keys within the scope[‘state’] dictionary.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Express middleware, changes to request object do not persist
I've tried several things already but seem to keep having the same issue. Soon as the middleware is left it looks like the...
Read more >
5.x API - Express.js
Returns middleware that only parses JSON and only looks at requests where the Content-Type header matches the type option. This parser accepts any...
Read more >
Persisting state locally - Human Redux
It is not the application itself. When I talk about persisting "state" locally in this chapter, I'm talking entirely about #2.
Read more >
Redux: Persisting the State to the Local Storage - Egghead.io
We will learn how to use store.subscribe() to efficiently persist some of the app's state to localStorage and restore it after a refresh....
Read more >
Using Redux-Persist to Store Your State in LocalStorage | by ...
You will need to import {compose} and {createStore} from 'redux', as well as {applyMiddleware} if you are using any other middleware. You will ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found