Postgres OAuth session adapter crashes in rowToSessionData

did:plc:fpruhuo22xkm5o7ttr2ktxdo opened this Oct 28, 2025 0 comments
did:plc:fpruhuo22xkm5o7ttr2ktxdo opened Oct 28, 2025

Postgres adapter for @slices/session crashes in at least two distinct ways:

 SyntaxError: "[object Object]" is not valid JSON
    at JSON.parse (<anonymous>)
    at g.rowToSessionData (.next/server/chunks/585.js:96:830)
    at g.get (.next/server/chunks/585.js:79:246)
    at async e.getSession (.next/server/chunks/585.js:1:8883)
 TypeError: a.created_at.getTime is not a function
    at g.rowToSessionData (.next/server/chunks/585.js:96:856)
    at g.get (.next/server/chunks/585.js:79:246)
    at async e.getSession (.next/server/chunks/585.js:1:8883)

The problems are:

  • We have BIGINT for times, so we should've used number. There's no need for getTime.
  • We have JSONB for data, so we should've treated it as a Record. There's no need for JSON.parse.

No activity yet.

cospan · schematic version control on atproto built on AT Protocol