Skip to content

fix: Reverting dot notation operations in beforeSave causes an error after the write - #10785

Open
mtrezza wants to merge 2 commits into
parse-community:alphafrom
mtrezza:fix/before-save-revert-dot-operations
Open

mtrezza wants to merge 2 commits into
parse-community:alphafrom
mtrezza:fix/before-save-revert-dot-operations

Conversation

@mtrezza

@mtrezza mtrezza commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

Issue

Reverting dot notation operations in beforeSave causes an error after the write.

Tasks

  • Add tests

Summary by CodeRabbit

  • Bug Fixes
    • Reverting changes to nested fields during a save now restores their original values, including for delete and other field operations, while allowing unrelated updates to proceed.
    • Save responses now omit protected fields and their nested values when the requester lacks permission, while retaining permitted public fields. Authorized responses continue to include protected values.
    • Reverted field values are reflected consistently in saved objects and subsequent save-related updates.

@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 Oct 11, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 3640cf8c-bce6-4352-be0f-0b17d684a159


📥 Commits

Reviewing files that changed from the base of the PR and between 4119ea8 and 21b4c25.



📒 Files selected for processing (1)
  • spec/CloudCode.spec.js


Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.




📝 Walkthrough
📝 Walkthrough

Walkthrough

RestWrite now handles reverted dotted fields using original data and filters protected fields and their descendants from responses. Tests cover REST updates, save triggers, fetched objects, LiveQuery updates, and response behavior across authentication modes.

Changes

Nested field reversion

Layer / File(s) Summary
Response reconciliation
src/RestWrite.js
Protected-field filtering now removes response keys nested beneath protected fields. Reverted operations are applied to a copy of the write data. For dotted paths, the code restores the original value when present or applies Delete when absent.
Reversion behavior validation
spec/CloudCode.spec.js, spec/ProtectedFields.spec.js
Tests cover reverted operations in REST saves, SDK and fetched objects, afterSave, LiveQuery updates, and responses under four authentication modes.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes



Merge Risk: ⚪ Minimal · up to 21b4c

The change reconciles reverted nested fields and filters protected response descendants; the reviewed paths and regression cases show no concrete merge-blocking risk.


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Description check Error The description identifies the issue and confirms that tests were added, but it omits the required Approach section and does not remove the inapplicable unchecked tasks. Add an Approach section that explains the RestWrite.js fix and regression tests. Remove unchecked tasks that do not apply, or mark applicable completed tasks accordingly.
✅ Passed checks (6 passed)
Check name Status Explanation
Title check Passed The title begins with the required fix: prefix, uses a capitalized first word, and clearly describes the dot-notation revert error addressed by the changes.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
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 security vulnerability is introduced by the reviewed changes. The production diff only (1) removes response keys that equal a protected field or are its dotted descendants, which strengthens protec…
Engage In Review Feedback Passed No review feedback comments were provided. The current review produced zero actionable findings, and no CodeRabbit review threads were returned. Therefore, there was no feedback that the contributor c…


  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR



  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 11, 2026
@codecov

codecov Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.00%. Comparing base (36af858) to head (21b4c25).
⚠️ Report is 1 commits behind head on alpha.

Additional details and impacted files
@@            Coverage Diff             @@
##            alpha   #10785      +/-   ##
==========================================
- Coverage   94.00%   94.00%   -0.01%     
==========================================
  Files         193      193              
  Lines       17125    17128       +3     
  Branches      259      259              
==========================================
+ Hits        16099    16101       +2     
- Misses       1004     1005       +1     
  Partials       22       22              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@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.

Pre-merge checks failed. Please resolve the failing checks before merging.

This branch has not been deployed

No deployments
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