Skip to content

fix: Prevent Config table crash when a parameter value is null - #3424

Merged
mtrezza merged 4 commits into
parse-community:alphafrom
Moumouls:fix/config-null-param-tabledata
Jul 23, 2026
Merged

mtrezza merged 4 commits into
parse-community:alphafrom
Moumouls:fix/config-null-param-tabledata

Conversation

@Moumouls

@Moumouls Moumouls commented Jul 23, 2026 •

Copy link
Copy Markdown
Member

Pull Request

Issue

Cloud Config table crashed when a parameter value was null. typeof null === 'object', so tableData() accessed value.__type and threw before rendering.

Approach

  • Guard File/GeoPoint parsing so null values are skipped (value !== null before reading __type)
  • Extract the table-building logic into a pure buildConfigTableData helper so unit tests cover the behavior without React component mocks
  • Unit tests cover null, string, File, and GeoPoint parameter values

Tasks

  • Add tests

Summary by CodeRabbit

  • Bug Fixes
    • Improved configuration table rendering to safely handle parameters with null values.
    • Correctly converts and displays serialized File and GeoPoint configuration values, preserving masterKeyOnly behavior (including defaulting to false when metadata is missing).
    • Ensures configuration table entries are consistently ordered by parameter name.
  • Tests
    • Added Jest coverage for the configuration table data builder, including null inputs and proper normalization of File/GeoPoint values and masterKeyOnly flags.

Null config params are typeof object, so accessing __type threw; skip File/GeoPoint parsing when value is null.
@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 23, 2026 •

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cce24e54-0e0b-435f-8ee0-ca36b04a70ed

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Configuration table row construction is extracted into buildConfigTableData, which normalizes serialized Parse values, sorts rows, and propagates master-key metadata. Config.tableData() delegates to the helper, with tests covering null, missing metadata, File, and GeoPoint values.

Changes

Config table data

Layer / File(s) Summary
Table data helper and tests
src/lib/ConfigTableData.js, src/lib/tests/Config.tableData.test.js
Adds normalization and sorting for configuration entries, including serialized File and GeoPoint values, with coverage for null values, missing metadata, and masterKeyOnly flags.
Dashboard table integration
src/dashboard/Data/Config/Config.react.js
Defaults master-key metadata to an Immutable map and replaces inline tableData() row-building logic with buildConfigTableData(params, masterKeyOnlyParams).

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 7
✅ Passed checks (7 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the PR’s main fix and follows the required prefix and capitalization rules.
Description check ✅ Passed The description follows the template with Issue, Approach, and Tasks sections, and it clearly explains the fix and tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Security Check ✅ Passed No new advisory-like pattern (prototype pollution/XSS/unsafe eval/deserialization) appears; this only adds null guards and helper extraction.
Engage In Review Feedback ✅ Passed PASS: A follow-up commit hardens masterKeyOnly handling and adds a regression test, showing review feedback was addressed rather than ignored.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/lib/tests/Config.tableData.test.js (1)

40-60: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Cover the File and GeoPoint conversion branches.

This regression test covers null and a string only. A regression in either modified serialized Parse conversion path would still pass. Add File and GeoPoint fixtures and assert they remain normalized before relying on manual validation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/tests/Config.tableData.test.js` around lines 40 - 60, Extend the
tableData regression test around Config.prototype.tableData to include
serialized Parse File and GeoPoint parameter fixtures alongside the existing
null and string values. Assert that both values are converted to their expected
normalized representations, covering each modified conversion branch before the
existing validation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/lib/tests/Config.tableData.test.js`:
- Around line 40-60: Extend the tableData regression test around
Config.prototype.tableData to include serialized Parse File and GeoPoint
parameter fixtures alongside the existing null and string values. Assert that
both values are converted to their expected normalized representations, covering
each modified conversion branch before the existing validation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 83653b63-4c87-4434-b15e-052e6e9bb163

📥 Commits

Reviewing files that changed from the base of the PR and between f52c746 and bd7dee0.

📒 Files selected for processing (2)
  • src/dashboard/Data/Config/Config.react.js
  • src/lib/tests/Config.tableData.test.js

@Moumouls

Copy link
Copy Markdown
Member Author

@mtrezza checked locally in our staging env, the fix is working

Comment thread src/lib/tests/Config.tableData.test.js Resolved

@mtrezza mtrezza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Note also that the pre-merge checks are unaddressed.

Move null-safe File/GeoPoint normalization into a pure helper so tests
no longer need extensive React component mocks, and cover File/GeoPoint paths.
@Moumouls

Copy link
Copy Markdown
Member Author

@mtrezza Addressed both points:

  1. Test mocks — extracted buildConfigTableData into a pure helper; the unit test no longer imports Config.react or uses those component mocks. Also added File/GeoPoint coverage.
  2. Pre-merge checks — PR description now follows the template (Issue / Approach / Tasks).

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

@Moumouls: I’ll review the updated implementation and its focused test coverage.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

@Moumouls Thanks—the updated pure-helper test coverage and PR-template cleanup are noted. I’ll review the revised changes.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/lib/tests/Config.tableData.test.js (1)

15-24: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Cover the missing-metadata input used by production.

This test passes Map(), so it cannot catch the helper’s .get() crash when Config.tableData() supplies {}. Add a regression case matching the production fallback after the contract is fixed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/tests/Config.tableData.test.js` around lines 15 - 24, Add a
regression test alongside the existing null-parameter case that calls
buildConfigTableData with the same parameter map and a plain empty object ({})
for missing metadata, matching Config.tableData()’s production fallback. Assert
it does not throw and preserves the expected table rows, including null values.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/ConfigTableData.js`:
- Around line 10-13: Fix the metadata-map contract across all affected sites:
update buildConfigTableData to safely accept missing metadata or explicitly
require a map; in src/dashboard/Data/Config/Config.react.js lines 477-483,
replace the plain-object fallback with an empty Immutable map; and in
src/lib/tests/Config.tableData.test.js lines 15-24, add regression coverage for
absent masterKeyOnly metadata.

---

Nitpick comments:
In `@src/lib/tests/Config.tableData.test.js`:
- Around line 15-24: Add a regression test alongside the existing null-parameter
case that calls buildConfigTableData with the same parameter map and a plain
empty object ({}) for missing metadata, matching Config.tableData()’s production
fallback. Assert it does not throw and preserves the expected table rows,
including null values.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 853d6c56-19a7-46ac-8bb9-8e1fde43318b

📥 Commits

Reviewing files that changed from the base of the PR and between bd7dee0 and 85eb86d.

📒 Files selected for processing (3)
  • src/dashboard/Data/Config/Config.react.js
  • src/lib/ConfigTableData.js
  • src/lib/tests/Config.tableData.test.js

Comment thread src/lib/ConfigTableData.js Resolved
Use an Immutable Map fallback and defensive .get access so missing metadata no longer crashes table rendering, with a regression test covering the production {} case.
@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

@Moumouls I’ll review the updated helper extraction and its null, File, GeoPoint, and metadata-handling coverage.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@mtrezza
mtrezza merged commit 7150acf into parse-community:alpha Jul 23, 2026
11 checks passed
parseplatformorg pushed a commit that referenced this pull request Jul 23, 2026
# [9.3.0-alpha.2](9.3.0-alpha.1...9.3.0-alpha.2) (2026-07-23)

### Bug Fixes

* Prevent Config table crash when a parameter value is null ([#3424](#3424)) ([7150acf](7150acf))
@parseplatformorg

Copy link
Copy Markdown
Contributor

🎉 This change has been released in version 9.3.0-alpha.2

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Jul 23, 2026
parseplatformorg pushed a commit that referenced this pull request Nov 4, 2026
# [10.0.0](9.2.0...10.0.0) (2026-11-04)

### Bug Fixes

* Add Cancel and Add buttons to the add-row modal ([#1995](#1995)) ([#3383](#3383)) ([2d1b739](2d1b739))
* Advertise localhost instead of 0.0.0.0 in the dashboard startup message ([#3410](#3410)) ([33ce7b8](33ce7b8))
* Bump body-parser from 2.2.2 to 2.3.0 ([#3465](#3465)) ([662899b](662899b))
* Bump body-parser from 2.3.0 to 2.4.0 ([#3508](#3508)) ([cb9caf8](cb9caf8))
* Bump brace-expansion from 1.1.13 to 1.1.21 ([#3454](#3454)) ([937fe17](937fe17))
* Bump glob from 10.4.5 to 10.5.0 and minimatch from 9.0.1 to 9.0.9 ([#3467](#3467)) ([f31ada5](f31ada5))
* Bump immutable from 5.1.5 to 5.1.9 ([#3457](#3457)) ([5097c04](5097c04))
* Bump markdown-it from 14.3.0 to 14.3.3 ([#3494](#3494)) ([12d7cc0](12d7cc0))
* Bump parse from 8.5.0 to 8.6.2 ([#3468](#3468)) ([8a4c12b](8a4c12b))
* Bump proxy-addr from 2.0.7 to 2.0.8 ([#3490](#3490)) ([e017c62](e017c62))
* Bump qs from 6.15.3 to 6.16.0 ([#3458](#3458)) ([04f5acb](04f5acb))
* Info panel data not loaded when opened over an existing selection ([#3384](#3384)) ([4879959](4879959))
* Prevent Config table crash when a parameter value is null ([#3424](#3424)) ([7150acf](7150acf))
* Remote access restrictions not enforced when running behind a reverse proxy ([#3436](#3436)) ([60cb379](60cb379))
* Security upgrade Docker image from Node.js 20 to 24 ([#3518](#3518)) ([9dc2c30](9dc2c30))

### Features

* Add support for Node.js 26 ([#3525](#3525)) ([bdc5d62](bdc5d62))
* React 19 + react-router 7 + GraphiQL 5 coordinated upgrade ([#3409](#3409)) ([c3e16c2](c3e16c2))
* Remove Node 20 support and increase minimum required Node 22 version to `22.13.0` ([#3527](#3527)) ([2ff9098](2ff9098))

### BREAKING CHANGES

* Removes support for Node 20 and increases the minimum required Node 22 version to `22.13.0`. ([2ff9098](2ff9098))
@parseplatformorg

Copy link
Copy Markdown
Contributor

🎉 This change has been released in version 10.0.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:released Released as stable version state:released-alpha Released as alpha version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants