fix(database): prevent React #31 crash when opening models with object values - #305
Merged
kkopanidis merged 2 commits intoAug 11, 2026
Merged
Conversation
Model detail crashed when schema defaults or document fields contained
plain objects (e.g. { startDate, endDate, nights }) because those values
were rendered as React children. Normalize defaults for the schema editor
and coerce document/relation values through a shared display formatter.
Drop unnecessary comments, over-guards, and a formatDisplayValue use in document-panel that would have broken datetime-local inputs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Opening a model detail page crashed with React error #31 when a schema default or document field contained a plain object such as
{ startDate, endDate, nights }. React cannot render objects as children; the UI was passing those values straight into JSX in a few places (and schema field defaults were not normalized for text inputs).Changes
formatDisplayValue/formatCellDisplayValue/normalizeFieldDefaulthelpersTest plan
{ startDate, endDate, nights }— grid renders a JSON preview badge instead of crashing