Skip to content

Comments plugin: null equality bug in Drizzle/Kysely adapters causes top-level comments to disappear #94

@olliethedev

Description

@olliethedev

Context

We traced a comments rendering bug to adapter-level null equality handling in Better Auth's DB adapters.

When where clauses use operator: \"eq\" or \"ne\" with value: null, some adapter paths were generating SQL like column = null / column <> null instead of IS NULL / IS NOT NULL.

For the Comments plugin this shows up on top-level thread queries (parentId=null):

  • comments exist in DB
  • /api/data/comments?resourceId=...&resourceType=blog-post&parentId=null&status=approved... returns empty
  • but queries without parentId=null can still return rows

Upstream fix

Better Auth PR with the adapter fix:

That PR updates null handling for eq/ne in Drizzle and Kysely adapters to correctly use IS NULL / IS NOT NULL semantics.

Why this matters for btst/stack

@btst/stack plugins (especially Comments) rely on generic adapter where semantics.
If adapter null comparisons are wrong, top-level comments and similar null-filtered resources silently break for users on Drizzle or Kysely.

Request

Could we ensure @btst/* packages that depend on these adapters are bumped/released with the fixed Better Auth adapter versions, and call out this bugfix in release notes?

This should fix the Comments plugin null-parent filtering bug for anyone using Drizzle or Kysely.

Metadata

Metadata

Assignees

Labels

WIPWork in ProgressbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions