Query typing malfunction
session.Store#destroy
method
siteSessions#findBySid
Convex function
siteSessions table schema
8 Replies
it gets more confusing the more I look into it
here's another query in use, with the return type of the document
but the query in its definition also returns null, obviously because it could find nothing
Nevermind, I just found out a session gets rapidly created, logged, and deleted. Sorry!
But I still don't understand why the return type doesn't include
null
, when the query could find nothingthat's weird, it doesn't repro for me on the default settings. but i can repro if i set
strictNullChecks
to false. what is your project's tsconfig? i don't especially like the behavior, but it seems reasonable-ish to strip null from the inferred type if typescript is ignoring null anyway.just left my pc, will report back tomorrow
this is my tsconfig
didn't change
strictNullChecks
, let me try strict
oh.. yep, that's it
thanks for the tipinteresting, thanks for sharing. We'll look into why this tsconfig might strip nulls
:ScaraNod:
(this particularly confused me because a part of my monorepo has this particular tsconfig, while the rest has NextJS's generated one, and I forgot about strict)