Skip to content

fix: Nipmod package field — handle object payload#62

Open
danbuildss wants to merge 1 commit into
mainfrom
claude/pr-62-nipmod-package-fix
Open

fix: Nipmod package field — handle object payload#62
danbuildss wants to merge 1 commit into
mainfrom
claude/pr-62-nipmod-package-fix

Conversation

@danbuildss

Copy link
Copy Markdown
Owner

Problem

Nipmod sends package as a JSON object {name, id, ...} rather than a plain string. String(object) in JS produces "[object Object]" which is what was being stored in the DB and shown on the profile.

Fix

Extract a meaningful string from the object before storing:

  1. Try .name
  2. Fall back to .id
  3. Last resort: JSON.stringify

Plain string values pass through unchanged — backwards compatible.

SQL cleanup for existing rows

Run this in Supabase to fix the 181 existing [object Object] rows:

UPDATE tool_decision_events
SET package = COALESCE(
  raw->'package'->>'name',
  raw->'package'->>'id',
  raw->>'package',
  package
)
WHERE package = '[object Object]';

https://claude.ai/code/session_01RHDXdEbGQsn88zks713gye


Generated by Claude Code

Nipmod sends package as {name, id, ...} rather than a plain string.
String({}) produces "[object Object]" in the DB. Extract .name first,
fall back to .id, then JSON.stringify as last resort.

https://claude.ai/code/session_01RHDXdEbGQsn88zks713gye
@vercel

vercel Bot commented Jun 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
x402books-ai Ready Ready Preview, Comment Jun 6, 2026 10:04am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants