Skip to content

fix: moderation payload crash and test/verify 500 - #48

Merged
jjosef merged 1 commit into
mainfrom
fix/moderation-legacy-payload-and-verify-body
Sep 20, 2026
Merged

jjosef merged 1 commit into
mainfrom
fix/moderation-legacy-payload-and-verify-body

Conversation

@jjosef

@jjosef jjosef commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • POST /api/auth/test/verify 500s on dev: Fastify Body cannot be empty when content-type is set to application/json. The web request() helper always sent that header, including DevUnlock's empty POST. Only set Content-Type when there is a body.
  • TypeError: … payload.name: GSI2 STATUS#pending includes legacy contrib rows with no payload attribute. The queue rendered item.payload.name and crashed. listPending now drops those rows and queries newest-first so recent scraper candidates are not buried; the UI also optional-chains.
  • Approve rejects payload-less rows with 400 instead of throwing in the BFF.

Test plan

  • pnpm --filter @btfp/bff test (includes new listPending filter spec)
  • After merge, on dev.badthingsforpets.com/moderation while signed in but unverified: DevUnlock should not 500
  • Queue lists scraper candidates without a Safari/WebKit payload.name crash

Fastify 500s when the web client sends Content-Type application/json with
no body (DevUnlock's POST /auth/test/verify). Only set that header when
there is a body.

Legacy pending contribs have no payload at all; rendering item.payload.name
crashes the queue. Drop those rows from listPending (newest first) and
guard the UI.
@jjosef
jjosef merged commit 1e5390c into main Sep 20, 2026
1 check passed
@jjosef
jjosef deleted the fix/moderation-legacy-payload-and-verify-body branch September 20, 2026 16:44
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.

1 participant