Skip to content

ENG-1909 Add no-op Next.js content upsert endpoint#1220

Draft
maparent wants to merge 2 commits into
eng-2017-add-converter-for-crossapp-schemas-to-localconceptdatainputfrom
eng-1909-add-no-op-nextjs-content-upsert-endpoint
Draft

ENG-1909 Add no-op Next.js content upsert endpoint#1220
maparent wants to merge 2 commits into
eng-2017-add-converter-for-crossapp-schemas-to-localconceptdatainputfrom
eng-1909-add-no-op-nextjs-content-upsert-endpoint

Conversation

@maparent

@maparent maparent commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

https://linear.app/discourse-graphs/issue/ENG-1909/add-no-op-nextjs-content-upsert-endpoint

Content upsert, based on cross-app types.

This introduces a StandaloneContent type for upserting contents outside of concepts, following existing sync functions.

https://www.loom.com/share/cbffbfccbb384220bfe0a8aa80981b9d

@linear-code

linear-code Bot commented Jul 11, 2026

Copy link
Copy Markdown

ENG-1909

@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
discourse-graph Ready Ready Preview, Comment Jul 13, 2026 2:15pm

Request Review

@supabase

supabase Bot commented Jul 11, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project zytfjzqyijgagqxrzbmz because there are no changes detected in packages/database/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@maparent maparent force-pushed the eng-1909-add-no-op-nextjs-content-upsert-endpoint branch from 7fc6f80 to d43d61e Compare July 11, 2026 13:14
@maparent maparent marked this pull request as ready for review July 11, 2026 13:19
@maparent maparent requested a review from mdroidian July 11, 2026 13:19
Comment thread apps/website/app/utils/supabase/account.ts

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

View 2 additional findings in Devin Review.

Open in Devin Review

Comment thread packages/database/src/lib/crossAppConverters.ts
Comment thread apps/website/app/api/internal/space/[id]/content/route.ts
@maparent maparent removed the request for review from mdroidian July 13, 2026 14:04
[dbVarName]: null,
[localVarName]: null,
[inlineVarName]: null,
...decodeRef(ref, dbVarName, localVarName),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Runtime error when ref is undefined. The function decodeRefWithInlineNulls accepts an optional ref?: Ref parameter (line 68), but unconditionally calls decodeRef(ref, ...) on line 79. This will crash when ref is undefined, which occurs in the actual usage on lines 144-148 and 149-153 where no ref parameter is passed.

Fix by adding a conditional check:

return {
  [dbVarName]: null,
  [localVarName]: null,
  [inlineVarName]: null,
  ...(ref ? decodeRef(ref, dbVarName, localVarName) : {}),
} as Record<DbVarName, number | null> &
  Record<LocalVarName, string | null> &
  Record<InlineVarName, null>;
Suggested change
...decodeRef(ref, dbVarName, localVarName),
...(ref ? decodeRef(ref, dbVarName, localVarName) : {}),

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@maparent maparent marked this pull request as draft July 13, 2026 19:52
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