-
Notifications
You must be signed in to change notification settings - Fork 20
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
Data cache not functioning since 3.3.1 #75
Comments
I was under the impression that whenever a new event is created (for example when using $fetch in a component to get some data from a server handler) that the hooks that add the cache context are also called again. But I could be wrong here. Originally, the context was actually set on Could you tell me in what scenario exactly the data cache was not working? I assume it's not generally not working, right? The data cache feature is covered by several E2E tests; I would be quite shocked if it works in tests but doesn't work in actual installations. |
Turns out this was just a configuration error in the module's tests. After fixing, all tests are green. I assume it has to do with using the |
I can reproduce the issue by using |
Hey.
I noticed that my data cache stopped functioning ever since I upgraded to 3.3.3 (from 3.2). I went through the code, debugged some, did some testing by myself and I feel like I found an issue.
When an event is extended in the 'request' nitro hook, any changes introduced to the event are lost, only event.context changes persist:
FYI - I am doing SSR in SWR mode (no pregenaration).
Apparently Nitro might create new events through lifecycle and it won't be able to copy over keys that it is not aware of.
This might also happen in middlewares.
Would you welcome a PR that puts stuff on event.context instead of just event?
The text was updated successfully, but these errors were encountered: