You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.
I use mongodb driver for storageOptions but I think this would probably happen with any asyn storage. The problem I describe here does not happen when using memory storage.
I have 2 requests to my api, called in a sequence. First request modifies the session, second request reads it.
I ended up using an other workaround, that is overwrite the session in the database myself instead of waiting for the plugin to do it, it solves my problem but may create other issues.
event.res.on('finish',async()=>{// Session id may not exist if session was deletedconstsession=awaitgetSession(event)if(!session){return}awaitsetStorageSession(session.id,event.context.session)})
It looks like h3 sends the response before the callbacks on the finished events are done so I'm not sure what to do about that.
Describe the bug
Using an async storage (in my case mongodb), when calling 2 requests in a sequence, first request modifies the session, the second reads it, data is not updated in the session in request 2.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered:
Environment
Reproduction
I use mongodb driver for storageOptions but I think this would probably happen with any asyn storage. The problem I describe here does not happen when using memory storage.
I have 2 requests to my api, called in a sequence. First request modifies the session, second request reads it.
When session value is read in endpoint2, the changes made in endpoint1 are absent.
I can mitigate that as a workaround doing something like:
I ended up using an other workaround, that is overwrite the session in the database myself instead of waiting for the plugin to do it, it solves my problem but may create other issues.
It looks like h3 sends the response before the callbacks on the finished events are done so I'm not sure what to do about that.
Describe the bug
Using an async storage (in my case mongodb), when calling 2 requests in a sequence, first request modifies the session, the second reads it, data is not updated in the session in request 2.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: