Skip to content

fix: Render Date value in non-Date column instead of crashing (#1927)#3395

Open
dblythy wants to merge 1 commit into
parse-community:alphafrom
dblythy:fix/1927-expiresat-nondate-crash
Open

fix: Render Date value in non-Date column instead of crashing (#1927)#3395
dblythy wants to merge 1 commit into
parse-community:alphafrom
dblythy:fix/1927-expiresat-nondate-crash

Conversation

@dblythy

@dblythy dblythy commented Jul 5, 2026

Copy link
Copy Markdown
Member

Closes #1927

Problem

If a column named expiresAt is added to a class with a type other than Date (e.g. String) and given a value, the data browser renders a blank/white page. The console shows:

Minified React error #31 … args[]=Sun Dec 31 2000 16:00:00 GMT-0800 (Pacific Standard Time)

React error #31 is "Objects are not valid as a React child": a Date object is being rendered directly into JSX.

Root cause

expiresAt is a reserved Parse field name. Parse Server coerces it to a Date on read regardless of the column type the schema declares:

GET /parse/classes/TestClass
→ "expiresAt": { "__type": "Date", "iso": "2001-01-01T00:00:00.000Z" }   // schema says String

The Parse JS SDK decodes that into a real Date instance, so the data browser receives value = <Date> while the cell's type prop is String. BrowserCell.renderCellContent() keys its whole if/else chain off this.props.type and has no default branch, so for type === 'String' nothing matches and the raw Date object is set as the cell content and rendered as a JSX child, crashing the tree.

Fix

src/components/BrowserCell/BrowserCell.react.js:

  1. Render a Date value as a formatted string (via the existing dateStringUTC helper) even when the declared column type is not Date, so a Date reaching a non-Date column no longer crashes.
  2. While here, fix a latent bug in the type === 'Date' branch: its guards tested an out-of-scope value variable (always undefined), so the {__type:'Date', iso} / string conversions were dead code and mutated the read-only this.props.value. It now uses a local variable, so a Date-typed column given a {__type}/string value is handled instead of throwing.

Verification

Added src/lib/tests/BrowserCell.test.js cases (red→green): a Date value in a non-Date column renders as a string without throwing, and a Date-typed column given a date string renders without throwing.

Runtime, class with a String expiresAt column and value "2001-01-01":

Before: opening the class blanks the whole page; console logs Objects are not valid as a React child (found: Mon Jan 01 2001 …):

Before: blank page

After: the browser loads and the expiresAt cell shows the formatted date; no console errors:

After: dashboard loads, expiresAt cell renders

@parse-github-assistant

Copy link
Copy Markdown

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant Bot changed the title fix: render Date value in non-Date column instead of crashing (#1927) fix: Render Date value in non-Date column instead of crashing (#1927) Jul 5, 2026
@parse-github-assistant

Copy link
Copy Markdown

🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review.

Tip

  • Keep pull requests small. Large PRs will be rejected. Break complex features into smaller, incremental PRs.
  • Use Test Driven Development. Write failing tests before implementing functionality. Ensure tests pass.
  • Group code into logical blocks. Add a short comment before each block to explain its purpose.
  • We offer conceptual guidance. Coding is up to you. PRs must be merge-ready for human review.
  • Our review focuses on concept, not quality. PRs with code issues will be rejected. Use an AI agent.
  • Human review time is precious. Avoid review ping-pong. Inspect and test your AI-generated code.

Note

Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect.

Caution

Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement. Our CI and AI review are safeguards, not development tools. If many issues are flagged, rethink your development approach. Invest more effort in planning and design rather than using review cycles to fix low-quality code.

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 11 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c58a4d93-2789-4848-8107-1dc729839ca3

📥 Commits

Reviewing files that changed from the base of the PR and between 9db24be and 1716931.

📒 Files selected for processing (2)
  • src/components/BrowserCell/BrowserCell.react.js
  • src/lib/tests/BrowserCell.test.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

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.

Dashboard doesn't load when there is value in non-Date "expiresAt" column

1 participant