Skip to content

Prohibit NULL code points in written strings - #42

Merged
lberrymage merged 1 commit into
mainfrom
no-null-writes
Oct 30, 2026
Merged

lberrymage merged 1 commit into
mainfrom
no-null-writes

Conversation

@lberrymage

@lberrymage lberrymage commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

The Accrescent server supports PostgreSQL as its production data store backend. PostgreSQL generally supports storing UTF-8 in its text type; however, due to historical limitations, it does not support storing NULL code points in text values. As a result, any attempted write to a string from the console API which contains a NULL code point cannot be stored as-is; instead, the server returns an internal server error since the error occurs at the database level.

To prevent such errors from occurring while still saving API input as-is, prohibit NULL code points in written strings via protovalidate so that they are rejected as soon as possible.

This change also removes AppDraftListingText from the request path; it is returned only in responses so that we can enforce NULL-freeness on the request path but not guarantee it in responses in case we're able to accept NULL code points in the future.

@lberrymage lberrymage added the buf skip breaking Skip Buf breaking change detection for this PR label Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed⏩ skippedOct 30, 2026, 6:57 PM

The Accrescent server supports PostgreSQL as its production data store
backend. PostgreSQL generally supports storing UTF-8 in its text type;
however, due to historical limitations, it does not support storing NULL
code points in text values. As a result, any attempted write to a string
from the console API which contains a NULL code point cannot be stored
as-is; instead, the server returns an internal server error since the
error occurs at the database level.

To prevent such errors from occurring while still saving API input
as-is, prohibit NULL code points in written strings via protovalidate so
that they are rejected as soon as possible.

This change also removes AppDraftListingText from the request path; it
is returned only in responses so that we can enforce NULL-freeness on
the request path but not guarantee it in responses in case we're able to
accept NULL code points in the future.
@lberrymage
lberrymage enabled auto-merge (rebase) October 30, 2026 18:59
@lberrymage
lberrymage merged commit 61eb0d1 into main Oct 30, 2026
5 checks passed
@lberrymage
lberrymage deleted the no-null-writes branch October 31, 2026 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

buf skip breaking Skip Buf breaking change detection for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant