Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

kidlisp(datomic): stop handle clobber in recent list

toMongoShape was spread after the explicit handle field, so every entry
in /api/store-kidlisp?recent=true lost its handle (shape.handle was
null because opts.handle wasn't being passed). The server-side
?handle=@x filter then matched zero rows, which is why keep.kidlisp.com
showed an empty index for logged-in users.

Pass the looked-up handle into toMongoShape and let the shape be
authoritative; only code and preview are layered on top.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

+8 -11
+8 -11
system/netlify/functions/store-kidlisp-datomic.mjs
··· 351 351 352 352 const shaped = pieces 353 353 .map((p) => { 354 - const handle = p.user ? handles.get(p.user) : null; 354 + const handle = p.user ? handles.get(p.user) || null : null; 355 + const shape = toMongoShape(p, { 356 + handle, 357 + contract: requestedContract, 358 + contractProfile: requestedContractProfile, 359 + contractVersion: requestedContractVersion, 360 + }) || {}; 355 361 return { 362 + ...shape, 356 363 code: p.code, 357 - source: p.source, 358 364 preview: 359 365 p.source && p.source.length > 40 360 366 ? p.source.substring(0, 37) + "..." 361 367 : p.source, 362 - when: p.when, 363 - hits: p.hits, 364 - user: p.user || null, 365 - handle: handle || null, 366 - ...(toMongoShape(p, { 367 - contract: requestedContract, 368 - contractProfile: requestedContractProfile, 369 - contractVersion: requestedContractVersion, 370 - }) || {}), 371 368 }; 372 369 }) 373 370 .filter((p) => {