Skip to content

feat: Allow Parse.Object field names to begin with underscore _ to access internal fields of Parse Server #2475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 5, 2025

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Mar 3, 2025

Pull Request

Issue

With the introduction of access scopes, internal fields can be read from and written to.

Closes: #2474

Approach

  • Allow fields to start with underscore
  • Match invalid key error message to the server

Tasks

  • Add tests
  • Add changes to documentation (guides, repository pages, code comments)

Copy link

Thanks for opening this pull request!

Copy link

codecov bot commented Mar 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (60c8398) to head (f5d60ae).
Report is 32 commits behind head on alpha.

Additional details and impacted files
@@            Coverage Diff            @@
##             alpha     #2475   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           64        64           
  Lines         6256      6256           
  Branches      1451      1447    -4     
=========================================
  Hits          6256      6256           

☔ View full report in Codecov by Sentry.
📢 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.

@dplewis dplewis requested a review from a team March 3, 2025 01:07
mtrezza
mtrezza previously approved these changes Mar 5, 2025
@mtrezza mtrezza changed the title feat: Allow field names to start with underscore feat: Allow Parse.Object field names to start with underscore to access internal fields of Parse Server Mar 5, 2025
@mtrezza mtrezza changed the title feat: Allow Parse.Object field names to start with underscore to access internal fields of Parse Server feat: Allow Parse.Object field names to begin with underscore to access internal fields of Parse Server Mar 5, 2025
@mtrezza mtrezza changed the title feat: Allow Parse.Object field names to begin with underscore to access internal fields of Parse Server feat: Allow Parse.Object field names to begin with underscore _ to access internal fields of Parse Server Mar 5, 2025
@mtrezza
Copy link
Member

mtrezza commented Mar 5, 2025

Does this also remove the restriction for queries, for example Parse.Query.equals('_internalField', value), or hasn't there been any? A test may be useful for that.

@dplewis
Copy link
Member Author

dplewis commented Mar 5, 2025

The restriction for queries must be handled server side

@mtrezza
Copy link
Member

mtrezza commented Mar 5, 2025

So does the Parse JS SDK already allow sending a query with Parse.Query.equals('_internalField', value) to Parse Server?

@dplewis
Copy link
Member Author

dplewis commented Mar 5, 2025

Oh yes you can send the query

@mtrezza mtrezza merged commit 08e43ba into parse-community:alpha Mar 5, 2025
12 checks passed
@dplewis dplewis deleted the allow-underscore branch March 5, 2025 17:45
parseplatformorg pushed a commit that referenced this pull request Mar 5, 2025
# [6.1.0-alpha.1](6.0.0...6.1.0-alpha.1) (2025-03-05)

### Features

* Allow `Parse.Object` field names to begin with underscore `_` to access internal fields of Parse Server ([#2475](#2475)) ([08e43ba](08e43ba))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 6.1.0-alpha.1

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Mar 5, 2025
parseplatformorg pushed a commit that referenced this pull request Mar 17, 2025
# [6.1.0](6.0.0...6.1.0) (2025-03-17)

### Features

* Add `Parse.Query` option `useMaintenanceKey` ([#2484](#2484)) ([2ead3f3](2ead3f3))
* Allow `Parse.Object` field names to begin with underscore `_` to access internal fields of Parse Server ([#2475](#2475)) ([08e43ba](08e43ba))
* Publish TypeScript definitions ([#2491](#2491)) ([fc3e573](fc3e573))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 6.1.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Mar 17, 2025
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.

Allow field name with underscore prefix in Parse.Object.set
3 participants