-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: let ctx.session
be undefined for missing session keys
#5
Comments
ctx.session
be undefined for missing sessionsctx.session
be undefined for missing session keys
We should probably still throw an error upon assignment to |
I'm guessing the type of |
I think so, too. It would be really annoying to work with. Then again ... we either have to accept that the types are wrong ( |
I get that it could be kind of annoying, but with filtering it'd be easy to get rid of updates missing the session object. We could even export a predicate ourselves, especially after we move sessions to a dedicated plugin |
What are you envisioning? |
yep, something like that |
That feels a bit annoying, don't you think? |
not really. the runtime check is already necessary for stuff that depend on the existence of a session key, well just reflect that in the types. |
I'd just like to find a way to make it unnecessary to check things at runtime. The current implementation doesn't need that and it would feel like a step back to require this from now on |
I might be missing something here, but I don't really get how this is true. isn't the whole purpose of this PQ to make the check easier? today, if you don't perform that runtime check, you risk getting an error |
I don't think you're missing something. It's just really annoying to be forced to check for
|
The fact that an error is thrown upon property access is really annoying. There is no good way of knowing whether session data exists, so we should change this behaviour.
The text was updated successfully, but these errors were encountered: