Highly ambitious ATProtocol AppView service and sdks

Postgres OAuth session adapter crashes in rowToSessionData #11

open
opened by danabra.mov

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.
sign up or login to add to the discussion
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:fpruhuo22xkm5o7ttr2ktxdo/sh.tangled.repo.issue/3m4awnqevj222