From 6bd0fe65e26e4a178eb922289994d197e9e8ed0a Mon Sep 17 00:00:00 2001 From: Albert Date: Sun, 9 Nov 2025 19:50:43 +0000 Subject: [PATCH] debug: Add logging for grapheme limit errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added detailed logging when posts exceed 300 grapheme limit to help debug the discrepancy between calculated and actual grapheme counts. Logs now include: - Post content preview - Detail URL being used - Link suffix grapheme count 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/api/nodes/route.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/api/nodes/route.ts b/app/api/nodes/route.ts index da0202e..a1db10b 100644 --- a/app/api/nodes/route.ts +++ b/app/api/nodes/route.ts @@ -156,6 +156,9 @@ export async function POST(request: NextRequest) { const finalGraphemes = getGraphemeLength(postText); if (finalGraphemes > 300) { console.error(`[POST /api/nodes] Post ${i + 1} exceeds 300 graphemes (${finalGraphemes})`); + console.error(`[POST /api/nodes] Post content: ${postText.substring(0, 200)}...`); + console.error(`[POST /api/nodes] Detail URL: ${detailUrl}`); + console.error(`[POST /api/nodes] Link suffix graphemes: ${getGraphemeLength(linkSuffix)}`); throw new Error(`Post exceeds 300 grapheme limit: ${finalGraphemes} graphemes`); }