Wrong types for `PaginationResult`
continueCursor
should be string | null
, now it's just string
Maybe it's just testing behavior. If it is, then there's a bug in convex-test
.7 Replies
Oh, I forgot to mention that I don't want to "leak"
numItems
, so I only pass the cursor
:
continueCursor is not the cursor passed in, it's a string returned from
.paginate
so it shouldn't be null
- if you're seeing null
come back I expect it's a bug in convex-test
- if that's the case can you file an issue on https://github.com/get-convex/convex-auth/issues ?GitHub
Issues · get-convex/convex-auth
Library for built-in auth. Contribute to get-convex/convex-auth development by creating an account on GitHub.
GitHub
Wrong types for
PaginationResult
· Issue #16 · get-convex/convex-...From Discord continueCursor should be string | null, now it's just string import type { PaginationResult } from 'convex/server' import { describe, expect, it } from 'vitest' imp...
Technically, the issue is not that the type is wrong, the result should never be null. It sounds like the issue is Convex test might return null
Just ran into this myself and lost time tracking it down to a
convex-test
issue, then opened a duplicate issue of the one posted by Delveroff 😅
Would be nice to have this fixed!
As noted here, I think the issue is just that we break before assigning a value to continueCursor
when isDone
is truthy. If I'm right, it should be trivial to fix the issue when there are greater than zero items in the result set. If there are zero, I'm guessing we'd need to produce some kind of dummy cursor value.should be fixed now
thanks for the report 🥇
Upgraded, confirmed fixed