Keep recipe_url out of dinner responses (Feature 12 review F1)
CI / ci (push) Successful in 2m36s
CI / ci (pull_request) Successful in 2m23s

A pasted recipe link may carry a personal token in its query, and the
dinners API returned it from create, list, get, patch and ground, where
other household clients and the PWA's cache of dinner reads could keep
it. Drop recipe_url from the public Dinner shape so it stays in the
database for grounding and dedupe only.

TestCreateDinnerByURL and TestCreateDinnerByName now assert the field is
absent; TestDinnerResponsesHideRecipeURL creates a Regular from a
token-bearing link and checks neither the create nor the list response
holds the link, host or token while the stored link remains.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-06 20:35:19 -04:00
co-authored by Claude Opus 5.5
parent 5dff7825d8
commit c15c8ec284
6 changed files with 58 additions and 14 deletions
@@ -196,7 +196,7 @@ describe('RegularsSettingsPage', () => {
const link = 'https://example.com/recipes/12345/beef-stew/'
const server = stubServer([], {
'POST /api/v1/dinners': () => {
const created = dinnerBody('d9', 'Beef stew', { grounding_status: 'pending', recipe_url: link })
const created = dinnerBody('d9', 'Beef stew', { grounding_status: 'pending' })
server.regulars = [created]
return jsonResponse(201, { ...created, grounding_job_id: 'job-1' })
},
-2
View File
@@ -10,7 +10,6 @@ export type DinnerBody = {
cuisine: string | null
is_favorite: boolean
recipe_id: string | null
recipe_url: string | null
photo_url: string | null
grounding_status: string
grounding_error: string | null
@@ -33,7 +32,6 @@ export function dinnerBody(id: string, name: string, overrides: Partial<DinnerBo
cuisine: null,
is_favorite: false,
recipe_id: null,
recipe_url: null,
photo_url: null,
grounding_status: 'grounded',
grounding_error: null,