kitsonk / kview

A web app for Deno KV

Home Page:https://kview.deno.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error drill-down keys

rracariu opened this issue · comments

The keys are stored as strings, for some reason kview wants to convert them to BigInt

An error occurred during route handling or page rendering.
SyntaxError: Cannot convert user_2b8oavU3nky3ec2MeMO82vMlwm to a BigInt
    at BigInt (<anonymous>)
    at pathToKey (https://deno.land/x/kview@0.9.1/utils/kv.ts:52:16)
    at GET (https://deno.land/x/kview@0.9.1/routes/api/kv/[id]/[...path].ts:30:39)
    at routes.<computed>.methods.<computed> (https://raw.githubusercontent.com/denoland/fresh/main/src/server/context.ts:461:20)
    at handler (https://raw.githubusercontent.com/denoland/fresh/main/src/server/router.ts:226:28)
    at ctx.next (https://raw.githubusercontent.com/denoland/fresh/main/src/server/compose.ts:97:32)
    at setStateFromCookies (https://deno.land/x/kview@0.9.1/routes/_middleware.ts:49:21)
    at eventLoopTick (ext:core/01_core.js:168:7)
    at async handler (https://raw.githubusercontent.com/denoland/fresh/main/src/server/context.ts:293:14)
    at async ext:deno_http/00_serve.js:455:18

Hmmm... must be a logic error in how keys are being deserialized from paths. Thanks for reporting.

🤦 the logic to detect BigInt keys in a path was very flawed. I hardened the whole serializing/deserializing. It is available in 0.10.1.

Works, thanks for the quick turnaround.