Skip to content

Conversation

@mtrezza
Copy link
Member

@mtrezza mtrezza commented Jan 25, 2026

Pull Request

Summary by CodeRabbit

  • Chores
    • Updated "parse" dependency from v8.0.0 to v8.0.3.
    • Updated "@parse/push-adapter" dependency from v8.1.0 to v8.2.0.
    • No functional or behavioral changes observed; these are patch/minor dependency updates aimed at maintenance and stability.

✏️ Tip: You can customize this high-level summary in your review settings.

@parse-github-assistant
Copy link

parse-github-assistant bot commented Jan 25, 2026

🚀 Thanks for opening this pull request!

@parseplatformorg
Copy link
Contributor

parseplatformorg commented Jan 25, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai
Copy link

coderabbitai bot commented Jan 25, 2026

📝 Walkthrough

Walkthrough

Bumps two dependencies in package.json: @parse/push-adapter from 8.1.08.2.0 and parse from 8.0.08.0.3. No other file edits or behavioral changes present.

Changes

Cohort / File(s) Summary
Dependency Updates
package.json
Updated "@parse/push-adapter" from 8.1.08.2.0 and "parse" from 8.0.08.0.3 (two single-line version changes)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete. It includes only boilerplate guidance but lacks required sections: no Issue link provided in 'Closes:', no 'Approach' section describing the changes, and no Tasks checked. Add the Issue reference in the 'Closes:' field, describe the approach/changes made, and update task checkboxes to reflect work completed.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: Upgrade to parse 8.0.3' directly and clearly summarizes the main change: upgrading the parse dependency to version 8.0.3.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 25, 2026
@mtrezza mtrezza changed the title feat: Upgrade to parse 8.0.1 feat: Upgrade to parse 8.0.2 Jan 25, 2026
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 25, 2026
@mtrezza
Copy link
Member Author

mtrezza commented Jan 25, 2026

@hajjarjoseph, there seems to be another issue; in Parse SDK >=8.0.1, Parse.initialize() only accepts 2 arguments (applicationId, javaScriptKey), so this fails:

Parse.initialize(config.appId, Parse.javaScriptKey, config.masterKey);

There is also an internal API Parse._initialize which accepts 3 arguments, but could it be that this issue has been introduced with 8.0.1?

There are also a bunch of more TypeErrors if you at the CI, also introduced with 8.0.1 presumably.

@mtrezza
Copy link
Member Author

mtrezza commented Jan 25, 2026

@coderabbitai investigate the issue described in #10021 (comment).

@coderabbitai
Copy link

coderabbitai bot commented Jan 25, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

@mtrezza I'll investigate the Parse.initialize() issue with the 8.0.1+ upgrade.


🏁 Script executed:

#!/bin/bash
# Search for all Parse.initialize() calls in the codebase
echo "=== Searching for Parse.initialize() calls ==="
rg -nP 'Parse\.initialize\s*\(' -A2 -B2

echo ""
echo "=== Searching for Parse._initialize() calls ==="
rg -nP 'Parse\._initialize\s*\(' -A2 -B2

echo ""
echo "=== Searching for masterKey parameter in initialize context ==="
rg -nP 'initialize.*masterKey|masterKey.*initialize' -C3

Length of output: 2547


🌐 Web query:

Parse JavaScript SDK 8.0.1 changelog breaking changes

💡 Result:

I couldn’t find any official Parse JS SDK (“parse” on npm) changelog entry that lists breaking changes specifically for v8.0.1—the public GitHub “Releases” page for parse-community/Parse-SDK-JS currently only shows releases up to 7.0.2 (2025-10-25). (github.com)

What I can verify:

  • parse v8.0.1 is published as the latest stable version (dated January 15, 2026). (classic.yarnpkg.com)
  • Since 8.0.1 is a patch release, it should not introduce breaking API changes under SemVer; breaking changes (if any) would be expected in 8.0.0 (major) rather than 8.0.1. (classic.yarnpkg.com)

If you want, paste the v8.0.1 changelog text you’re looking at (or tell me where you’re viewing it), and I’ll extract/flag any potentially breaking items precisely.

Citations:


🌐 Web query:

Parse SDK JavaScript initialize method signature version 8

💡 Result:

In the Parse JavaScript SDK (including current docs), Parse.initialize takes up to three positional string arguments:

Parse.initialize(applicationId: string, javascriptKey?: string, masterKey?: string): void

Usage examples from the official JS guide: Parse.initialize("YOUR_APP_ID", "YOUR_JAVASCRIPT_KEY") (and optionally a third "YOUR_MASTERKEY"), then set Parse.serverURL. [1]

Source(s)
[1] (docs.parseplatform.org)

Citations:


🌐 Web query:

Parse SDK JS github repository Parse.initialize masterKey parameter removed

💡 Result:

The Parse JavaScript SDK has not “removed” the Master Key concept, but you generally can’t (and shouldn’t) use the Master Key from browser code.

What’s going on:

  • The official JS guide still documents a 3rd Parse.initialize(appId, javascriptKey, masterKey) argument only for “safe environments” (server-side), never client-side. [1]
  • Historically, when people tried to pass a master key to Parse.initialize(...) in browser builds, useMasterKey: true could still fail; the commonly cited workaround is to set it separately via Parse.masterKey = '...' (again: only in trusted/server environments). [2]
  • useMasterKey is intended for Cloud Code / Node usage (not browsers). [3]

So if you upgraded and “lost” the third parameter, the practical fix is usually:

  • Browser: don’t use masterKey; use Cloud Functions / proper ACL/CLP instead. [1]
  • Node/Cloud: use the Node build (parse/node) and either pass the masterKey in initialization (as in docs) or set Parse.masterKey explicitly. [1][2]

Sources:
[1] Parse JS Guide (Master Key warning + Parse.initialize(..., ..., masterKey) example) https://docs.parseplatform.org/js/guide/
[2] StackOverflow: “Parse JS SDK: Cannot use the Master Key, it has not been provided” (solution: Parse.masterKey = ...) https://stackoverflow.com/questions/40223311/parse-js-sdk-cannot-use-the-master-key-it-has-not-been-provided
[3] Parse JS SDK API docs (useMasterKey option notes) https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Object.html


🌐 Web query:

site:github.com/parse-community/Parse-SDK-JS Parse.initialize signature changes 2026

💡 Result:

I couldn’t find any evidence (in the Parse-SDK-JS repo or its 2025 release notes) that Parse.initialize(...) had a signature change going into 2026; the recent documented breaking change in the JS SDK is unrelated (it removes Parse.serverAuthType() / Parse.serverAuthToken() in v7.0.0). [1]

Current examples still show the classic 2-arg call:

Parse.initialize("YOUR_APP_ID", "unused");
Parse.serverURL = "http://localhost:1337/parse";

—which also implies the second parameter is effectively optional/unused in many Parse Server setups. [2]

Sources: [1] [3]


🏁 Script executed:

#!/bin/bash
# Check the parse package type definitions or source in node_modules
echo "=== Checking if node_modules exists and parse is installed ==="
if [ -d "node_modules/parse" ]; then
  echo "Parse package found"
  
  echo ""
  echo "=== Checking parse package.json version ==="
  cat node_modules/parse/package.json | jq -r '.version'
  
  echo ""
  echo "=== Looking for initialize method definition in type definitions ==="
  fd -e d.ts -e ts . node_modules/parse --exec grep -l "initialize" {} \; | head -5
  
  echo ""
  echo "=== Searching for initialize signature in found files ==="
  fd -e d.ts . node_modules/parse --exec grep -A5 "initialize" {} \;
else
  echo "node_modules not available in sandbox"
fi

echo ""
echo "=== Checking package-lock.json for parse version details ==="
if [ -f "package-lock.json" ]; then
  cat package-lock.json | jq '.packages["node_modules/parse"]'
fi

Length of output: 685


🏁 Script executed:

#!/bin/bash
# Clone the Parse SDK JS repository to investigate the initialize method signature
echo "=== Cloning Parse SDK JS repository ==="
git clone --depth 1 --branch 8.0.2 https://github.com/parse-community/Parse-SDK-JS.git /tmp/parse-sdk-js 2>&1 | grep -v "Cloning\|Receiving\|Resolving"

echo ""
echo "=== Searching for initialize method definition ==="
cd /tmp/parse-sdk-js
rg -nP "initialize\s*\(" --type ts --type js -A10 | grep -A10 "^src.*initialize"

echo ""
echo "=== Looking for Parse.initialize export or definition ==="
rg -nP "export.*initialize|static.*initialize" --type ts --type js -C5

echo ""
echo "=== Checking for type definitions ==="
fd "index.d.ts" -x cat {}

Length of output: 14019


🏁 Script executed:

#!/bin/bash
# Check the Parse SDK 8.0.0 to see if initialize signature was different
echo "=== Checking Parse SDK 8.0.0 for comparison ==="
git clone --depth 1 --branch 8.0.0 https://github.com/parse-community/Parse-SDK-JS.git /tmp/parse-sdk-js-8.0.0 2>&1 | grep -v "Cloning\|Receiving\|Resolving"

cd /tmp/parse-sdk-js-8.0.0

echo ""
echo "=== Parse.initialize signature in 8.0.0 ==="
rg -nP "initialize\(.*\)" src/Parse.ts -A10 | head -30

echo ""
echo "=== Comparing changes between 8.0.0 and 8.0.2 ==="
cd /tmp
git clone --depth 1 https://github.com/parse-community/Parse-SDK-JS.git /tmp/parse-compare 2>&1 | grep -v "Cloning\|Receiving\|Resolving"
cd /tmp/parse-compare

echo ""
echo "=== Git log between 8.0.0 and 8.0.2 ==="
git log --oneline 8.0.0..8.0.2 | head -20

echo ""
echo "=== Looking for changes to initialize method ==="
git log --oneline --all --grep="initialize" | head -10

Length of output: 1894


🏁 Script executed:

#!/bin/bash
# Check Parse SDK 7.0.0 to compare with 8.0.0
echo "=== Cloning Parse SDK 7.0.0 for comparison ==="
git clone --depth 1 --branch 7.0.0 https://github.com/parse-community/Parse-SDK-JS.git /tmp/parse-sdk-js-7.0.0 2>&1 | grep -v "Cloning\|Receiving\|Resolving"

cd /tmp/parse-sdk-js-7.0.0

echo ""
echo "=== Parse.initialize signature in 7.0.0 ==="
rg -nP "^\s*initialize\(.*\)" src/Parse.ts -A10

echo ""
echo "=== Parse._initialize signature in 7.0.0 ==="
rg -nP "^\s*_initialize\(.*\)" src/Parse.ts -A10

Length of output: 1204


@mtrezza I've investigated the issue. Here's what I found:

Key Findings

The Parse.initialize() method in Parse SDK only accepts 2 arguments: applicationId and javaScriptKey. However, Parse Server is calling it with 3 arguments (including masterKey) in multiple locations:

Locations with incorrect 3-argument calls:

  1. src/ParseServer.ts:131:

    Parse.initialize(appId, javascriptKey || 'unused', masterKey);
  2. src/LiveQuery/ParseLiveQueryServer.ts:63:

    Parse.initialize(config.appId, Parse.javaScriptKey, config.masterKey);
  3. spec/helper.js:230:

    Parse.initialize('test', 'test', 'test');

Root Cause

This is NOT a breaking change introduced in 8.0.1. The signature has been the same since at least version 7.0.0. The Parse SDK provides two methods:

  • Parse.initialize(applicationId, javaScriptKey) - Public API, 2 arguments only
  • Parse._initialize(applicationId, javaScriptKey, masterKey?, maintenanceKey?) - Internal API, accepts up to 4 arguments

The public initialize() internally calls _initialize() with only the first 2 arguments, meaning the masterKey parameter is currently being silently ignored.

Solution

Replace Parse.initialize() with Parse._initialize() in all three locations to properly pass the masterKey:

- Parse.initialize(appId, javascriptKey || 'unused', masterKey);
+ Parse._initialize(appId, javascriptKey || 'unused', masterKey);

This issue may have existed for a while but could become more apparent with TypeScript strict type checking or if the SDK starts warning about extra parameters.

Would you like me to help plan the code changes to fix these issues?


🧠 Learnings used
Learnt from: mtrezza
Repo: parse-community/parse-server PR: 0
File: :0-0
Timestamp: 2025-12-02T08:00:20.138Z
Learning: For Parse Server 9 release (PR `#9938` and related), the parse/push-adapter dependency must be upgraded to version >= 8.0.0, not 7.0.0. Version 8.x drops support for Node 18.

Learnt from: mtrezza
Repo: parse-community/parse-server PR: 0
File: :0-0
Timestamp: 2025-12-02T08:00:08.440Z
Learning: For Parse Server 9 release preparation, the parse/push-adapter dependency should be upgraded to version >= 8.0.0, not 7.x, as version 8.x is required despite dropping Node 18 support (which aligns with Parse Server 9's removal of EOL Node versions).

Learnt from: EmpiDev
Repo: parse-community/parse-server PR: 9770
File: src/triggers.js:446-454
Timestamp: 2025-08-27T09:08:34.252Z
Learning: When analyzing function signature changes in Parse Server codebase, verify that call sites are actually incorrect before flagging them. Passing tests are a strong indicator that function calls are already properly aligned with new signatures.

Learnt from: mtrezza
Repo: parse-community/parse-server PR: 0
File: :0-0
Timestamp: 2025-11-08T13:46:04.940Z
Learning: When reviewing Parse Server PRs that add new features, always check whether the feature is documented in the README.md file, though for new Parse Server options this is optional rather than required.

Learnt from: mtrezza
Repo: parse-community/parse-server PR: 0
File: :0-0
Timestamp: 2025-12-02T06:55:53.808Z
Learning: When reviewing Parse Server PRs that add or modify Parse Server options, always verify that changes are properly reflected in three files: src/Options/index.js (where changes originate), src/Options/Definitions.js, and src/Options/docs.js. The correct workflow is: make changes in index.js first, then run `npm run definitions` to automatically replicate the changes to Definitions.js and docs.js.

Learnt from: EmpiDev
Repo: parse-community/parse-server PR: 9770
File: src/triggers.js:467-477
Timestamp: 2025-08-27T12:33:06.237Z
Learning: In the Parse Server codebase, maybeRunAfterFindTrigger is called in production with Parse.Query objects constructed via withJSON(), so the plain object query handling bug only affects tests, not production code paths.

Learnt from: mtrezza
Repo: parse-community/parse-server PR: 9445
File: spec/ParseLiveQuery.spec.js:1340-1375
Timestamp: 2025-05-09T09:59:06.289Z
Learning: New tests in the parse-server repository should use async/await with promise-based patterns rather than callback patterns with `done()`. The preferred pattern is to create a Promise that resolves when an expected event occurs, then await that Promise.

Learnt from: mtrezza
Repo: parse-community/parse-server PR: 9445
File: spec/ParseLiveQuery.spec.js:1340-1375
Timestamp: 2025-05-09T09:59:06.289Z
Learning: Tests in the parse-server repository should use promise-based approaches rather than callback patterns with `done()`. Use a pattern where a Promise is created that resolves when the event occurs, then await that promise.

Learnt from: mtrezza
Repo: parse-community/parse-server PR: 0
File: :0-0
Timestamp: 2025-11-17T15:02:48.786Z
Learning: For Parse Server PRs, always suggest an Angular commit convention PR title that would make a meaningful changelog entry for developers. Update the PR title suggestion on every commit. The format should be: type(scope): description. Common types include feat, fix, perf, refactor, docs, test, chore. The scope should identify the subsystem (e.g., graphql, rest, push, security). The description should be action-oriented and clearly convey the change's impact to developers.

Learnt from: mtrezza
Repo: parse-community/parse-server PR: 0
File: :0-0
Timestamp: 2025-11-17T15:02:24.824Z
Learning: For Parse Server PRs, always suggest an Angular-style PR title that would make a meaningful changelog entry for developers. Update the PR title suggestion with every new commit to the PR.

@mtrezza
Copy link
Member Author

mtrezza commented Jan 25, 2026

@coderabbitai So if someone uses the current Parse Server version with Parse JS SDK 8.x.x, and the master key is silently ignored, why are the potential issues?

@coderabbitai
Copy link

coderabbitai bot commented Jan 25, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for useMasterKey usage in the codebase to understand what operations rely on master key
echo "=== Searching for useMasterKey usage ==="
rg -nP '\buseMasterKey\s*:\s*true' -C3 | head -100

echo ""
echo "=== Checking Parse.Query operations with master key ==="
rg -nP 'new Parse\.Query.*useMasterKey|\.find\(.*useMasterKey|\.get\(.*useMasterKey' -C2 | head -80

echo ""
echo "=== Checking context around Parse.initialize calls ==="
echo "--- ParseServer.ts context ---"
rg -nP 'Parse\.initialize' src/ParseServer.ts -B5 -A20

echo ""
echo "--- ParseLiveQueryServer.ts context ---"
rg -nP 'Parse\.initialize' src/LiveQuery/ParseLiveQueryServer.ts -B5 -A20

echo ""
echo "=== Checking for Parse.Cloud.useMasterKey ==="
rg -nP 'Parse\.Cloud\.useMasterKey|Cloud\.useMasterKey' -C3 | head -50

Length of output: 15092


@mtrezza Good question. When the master key is silently ignored in Parse.initialize(), Parse Server's internal operations that require master key privileges will fail or behave incorrectly. Here are the potential issues:

Critical Impact Areas

1. Authentication & Session Validation

In src/Auth.js, Parse Server queries the _Session collection with { useMasterKey: true } to validate session tokens and fetch user data. Without the master key properly set:

  • Session validation queries may fail due to ACL restrictions
  • User authentication may be unreliable
  • Protected user fields won't be accessible

2. Role Resolution

Parse Server queries roles using { useMasterKey: true } in src/Auth.js when checking user permissions. Without master key:

  • Role-based permissions won't work correctly
  • ACL checks relying on role membership will fail
  • Security policies may be improperly enforced

3. Live Query Operations

In src/LiveQuery/SessionTokenCache.js and src/LiveQuery/ParseLiveQueryServer.ts, session and user queries use { useMasterKey: true } to:

  • Validate Live Query subscriptions
  • Fetch valid session tokens for users
  • Check subscription permissions

Without the master key, Live Query subscriptions may not work correctly.

4. Internal Data Access

Many internal operations need to bypass ACLs/CLPs:

  • Fetching user objects with user.fetch({ useMasterKey: true }) in Auth.js
  • Querying protected classes
  • System maintenance operations

Why It's Silent

The Parse JS SDK's Parse.initialize() method signature accepts only 2 parameters. When Parse Server passes 3 arguments, JavaScript silently ignores the extra argument without throwing an error. The internal SDK state never receives the master key, so all subsequent { useMasterKey: true } operations fail to apply master key privileges.

Current State

Given that tests are failing with Parse SDK 8.0.1+, it confirms that:

  • The issue was previously masked (possibly by TypeScript type coercion or SDK behavior differences)
  • Upgrading to 8.x makes the problem visible through test failures
  • Production instances using SDK 8.x would experience these authentication/authorization issues

The fix to use Parse._initialize() is critical for Parse Server to function correctly with SDK 8.x.


🧠 Learnings used
Learnt from: EmpiDev
Repo: parse-community/parse-server PR: 9770
File: src/triggers.js:446-454
Timestamp: 2025-08-27T09:08:34.252Z
Learning: When analyzing function signature changes in Parse Server codebase, verify that call sites are actually incorrect before flagging them. Passing tests are a strong indicator that function calls are already properly aligned with new signatures.

Learnt from: mtrezza
Repo: parse-community/parse-server PR: 0
File: :0-0
Timestamp: 2025-12-02T08:00:20.138Z
Learning: For Parse Server 9 release (PR `#9938` and related), the parse/push-adapter dependency must be upgraded to version >= 8.0.0, not 7.0.0. Version 8.x drops support for Node 18.

Learnt from: mtrezza
Repo: parse-community/parse-server PR: 0
File: :0-0
Timestamp: 2025-12-02T08:00:08.440Z
Learning: For Parse Server 9 release preparation, the parse/push-adapter dependency should be upgraded to version >= 8.0.0, not 7.x, as version 8.x is required despite dropping Node 18 support (which aligns with Parse Server 9's removal of EOL Node versions).

Learnt from: mtrezza
Repo: parse-community/parse-server PR: 0
File: :0-0
Timestamp: 2025-12-02T06:55:53.808Z
Learning: When reviewing Parse Server PRs that add or modify Parse Server options, always verify that changes are properly reflected in three files: src/Options/index.js (where changes originate), src/Options/Definitions.js, and src/Options/docs.js. The correct workflow is: make changes in index.js first, then run `npm run definitions` to automatically replicate the changes to Definitions.js and docs.js.

Learnt from: mtrezza
Repo: parse-community/parse-server PR: 0
File: :0-0
Timestamp: 2025-11-08T13:46:04.940Z
Learning: When reviewing Parse Server PRs that add new features, always check whether the feature is documented in the README.md file, though for new Parse Server options this is optional rather than required.

Learnt from: EmpiDev
Repo: parse-community/parse-server PR: 9770
File: spec/CloudCode.spec.js:446-469
Timestamp: 2025-08-26T14:06:31.853Z
Learning: In the Parse Server codebase, when handling query objects in maybeRunAfterFindTrigger, objects without a where property that contain options like limit/skip should be treated as query JSON with an empty where clause using the spread pattern { where: {}, ...query }, not nested as { where: query }.

Learnt from: mtrezza
Repo: parse-community/parse-server PR: 0
File: :0-0
Timestamp: 2025-11-17T15:02:24.824Z
Learning: For Parse Server PRs, always suggest an Angular-style PR title that would make a meaningful changelog entry for developers. Update the PR title suggestion with every new commit to the PR.

Learnt from: mtrezza
Repo: parse-community/parse-server PR: 0
File: :0-0
Timestamp: 2025-11-17T15:02:48.786Z
Learning: For Parse Server PRs, always suggest an Angular commit convention PR title that would make a meaningful changelog entry for developers. Update the PR title suggestion on every commit. The format should be: type(scope): description. Common types include feat, fix, perf, refactor, docs, test, chore. The scope should identify the subsystem (e.g., graphql, rest, push, security). The description should be action-oriented and clearly convey the change's impact to developers.

Learnt from: EmpiDev
Repo: parse-community/parse-server PR: 9770
File: src/triggers.js:467-477
Timestamp: 2025-08-27T12:33:06.237Z
Learning: In the Parse Server codebase, maybeRunAfterFindTrigger is called in production with Parse.Query objects constructed via withJSON(), so the plain object query handling bug only affects tests, not production code paths.

Learnt from: mtrezza
Repo: parse-community/parse-server PR: 9858
File: src/GraphQL/ParseGraphQLServer.js:176-178
Timestamp: 2025-09-21T15:43:32.265Z
Learning: The GraphQL playground feature in ParseGraphQLServer.js (applyPlayground method) is intended for development environments only, which is why it includes the master key in client-side headers.

@mtrezza
Copy link
Member Author

mtrezza commented Jan 25, 2026

@coderabbitai So should we change Parse Server to call Parse._initialize, or change the JS SDK to accept 3 params in Parse.initialize? I guess there is a reason why the masterKey is not part of the Parse.initialize and only of the internal Parse._initialize signature?

@coderabbitai
Copy link

coderabbitai bot commented Jan 25, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search the Parse SDK repository for comments/documentation explaining the distinction
# between Parse.initialize and Parse._initialize

echo "=== Cloning Parse SDK to check for documentation on initialize methods ==="
git clone --depth 1 --branch 8.0.2 https://github.com/parse-community/Parse-SDK-JS.git /tmp/parse-sdk-check 2>&1 | grep -v "Cloning\|Receiving\|Resolving"

cd /tmp/parse-sdk-check

echo ""
echo "=== Searching for comments around initialize and _initialize methods ==="
rg -nP "initialize.*applicationId|_initialize.*masterKey" src/Parse.ts -B5 -A15

echo ""
echo "=== Looking for JSDoc or comments explaining the purpose ==="
rg -nP "@param.*masterKey|@private|internal use" src/Parse.ts -B2 -A2

Length of output: 2428


@mtrezza Excellent question! Based on the Parse SDK source code, Parse Server should definitely use Parse._initialize(), not modify the public API. Here's why:

The Design Intent

The Parse SDK deliberately separates these two methods for security:

  1. Parse.initialize(applicationId, javaScriptKey) - Public API

    • Designed for client-side/browser code
    • Intentionally does NOT accept masterKey parameter
    • Prevents developers from accidentally exposing masterKey in client bundles
    • Internally just calls Parse._initialize() with 2 parameters
  2. Parse._initialize(applicationId, javaScriptKey, masterKey, maintenanceKey) - Internal API

    • Designed for server-side/Node.js code
    • Accepts masterKey and maintenanceKey parameters
    • The underscore prefix is a JavaScript convention indicating "internal/private API"

Evidence from Parse SDK Source

The JSDoc comment on Parse.initialize() actually mentions:

`@param` {string} [masterKey] Your Parse Master Key. (Node.js only!)

However, the actual method signature only accepts 2 parameters. This JSDoc is misleading/outdated, but the implementation is correct—it's a safeguard to keep masterKey out of the public API.

Recommendation

Parse Server should use Parse._initialize() because:

  • ✅ Parse Server is server-side code where masterKey is safe and necessary
  • ✅ The internal API exists specifically for server-side use cases like Parse Server
  • ✅ Maintains the security principle of keeping masterKey out of client-accessible APIs
  • ❌ Modifying Parse.initialize() to accept masterKey would undermine this security design

Action Required

Update all three locations in Parse Server:

  • src/ParseServer.ts:131
  • src/LiveQuery/ParseLiveQueryServer.ts:63
  • spec/helper.js:230

Would you like me to plan the code changes to make this fix?


🧠 Learnings used
Learnt from: EmpiDev
Repo: parse-community/parse-server PR: 9770
File: src/triggers.js:446-454
Timestamp: 2025-08-27T09:08:34.252Z
Learning: When analyzing function signature changes in Parse Server codebase, verify that call sites are actually incorrect before flagging them. Passing tests are a strong indicator that function calls are already properly aligned with new signatures.

Learnt from: mtrezza
Repo: parse-community/parse-server PR: 0
File: :0-0
Timestamp: 2025-12-02T06:55:53.808Z
Learning: When reviewing Parse Server PRs that add or modify Parse Server options, always verify that changes are properly reflected in three files: src/Options/index.js (where changes originate), src/Options/Definitions.js, and src/Options/docs.js. The correct workflow is: make changes in index.js first, then run `npm run definitions` to automatically replicate the changes to Definitions.js and docs.js.

Learnt from: mtrezza
Repo: parse-community/parse-server PR: 9858
File: src/GraphQL/ParseGraphQLServer.js:176-178
Timestamp: 2025-09-21T15:43:32.265Z
Learning: The GraphQL playground feature in ParseGraphQLServer.js (applyPlayground method) is intended for development environments only, which is why it includes the master key in client-side headers.

Learnt from: mtrezza
Repo: parse-community/parse-server PR: 0
File: :0-0
Timestamp: 2025-12-02T08:00:20.138Z
Learning: For Parse Server 9 release (PR `#9938` and related), the parse/push-adapter dependency must be upgraded to version >= 8.0.0, not 7.0.0. Version 8.x drops support for Node 18.

Learnt from: mtrezza
Repo: parse-community/parse-server PR: 0
File: :0-0
Timestamp: 2025-12-02T08:00:08.440Z
Learning: For Parse Server 9 release preparation, the parse/push-adapter dependency should be upgraded to version >= 8.0.0, not 7.x, as version 8.x is required despite dropping Node 18 support (which aligns with Parse Server 9's removal of EOL Node versions).

Learnt from: mtrezza
Repo: parse-community/parse-server PR: 0
File: :0-0
Timestamp: 2025-11-17T15:02:48.786Z
Learning: For Parse Server PRs, always suggest an Angular commit convention PR title that would make a meaningful changelog entry for developers. Update the PR title suggestion on every commit. The format should be: type(scope): description. Common types include feat, fix, perf, refactor, docs, test, chore. The scope should identify the subsystem (e.g., graphql, rest, push, security). The description should be action-oriented and clearly convey the change's impact to developers.

Learnt from: mtrezza
Repo: parse-community/parse-server PR: 0
File: :0-0
Timestamp: 2025-11-17T15:02:24.824Z
Learning: For Parse Server PRs, always suggest an Angular-style PR title that would make a meaningful changelog entry for developers. Update the PR title suggestion with every new commit to the PR.

Learnt from: mtrezza
Repo: parse-community/parse-server PR: 0
File: :0-0
Timestamp: 2025-11-08T13:46:04.940Z
Learning: When reviewing Parse Server PRs that add new features, always check whether the feature is documented in the README.md file, though for new Parse Server options this is optional rather than required.

@mtrezza mtrezza changed the title feat: Upgrade to parse 8.0.2 feat: Upgrade to parse 8.0.3 Jan 27, 2026
@mtrezza
Copy link
Member Author

mtrezza commented Jan 27, 2026

@hajjarjoseph we're still seeing a few type errors in the CI. Would you mind taking a look? I think this one is response for most of the errors:

TypeError: Cannot read properties of undefined (reading 'currentInstallationId')

It would be good if you could use a parse-server repo on the side in your dev environment and use your local parse clone as parse dependency. This way you can just run the parse-server tests yourself and see whether they all pass, before we merge the parse PR.

@hajjarjoseph
Copy link

Hey @mtrezza. No more failures when I did an override to @parse/push-adapter on my end.

The issue is that @parse/push-adapter@8.1.0 has parse@8.0.1 pinned. When parse-server uses parse@8.0.2 or higher, npm can't dedupe them, resulting in two separate parse modules loaded - each with its own CoreManager. Only one gets initialized via Parse.initialize(), causing errors in code that uses the other instance.

we just need to update @parse/push-adapter "parse" package

@codecov
Copy link

codecov bot commented Jan 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.54%. Comparing base (dc866be) to head (55861d8).
⚠️ Report is 2 commits behind head on alpha.

Additional details and impacted files
@@            Coverage Diff             @@
##            alpha   #10021      +/-   ##
==========================================
- Coverage   92.54%   92.54%   -0.01%     
==========================================
  Files         190      190              
  Lines       15489    15489              
  Branches      176      176              
==========================================
- Hits        14335    14334       -1     
- Misses       1142     1143       +1     
  Partials       12       12              

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

@mtrezza mtrezza changed the title feat: Upgrade to parse 8.0.3 feat: Upgrade to parse 8.0.3 and @parse/push-adapter 8.2.0 Jan 27, 2026
@mtrezza mtrezza merged commit 9833fdb into parse-community:alpha Jan 27, 2026
20 of 23 checks passed
parseplatformorg pushed a commit that referenced this pull request Jan 27, 2026
# [9.2.0-alpha.3](9.2.0-alpha.2...9.2.0-alpha.3) (2026-01-27)

### Features

* Upgrade to parse 8.0.3 and @parse/push-adapter 8.2.0 ([#10021](#10021)) ([9833fdb](9833fdb))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 9.2.0-alpha.3

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Jan 27, 2026
@mtrezza
Copy link
Member Author

mtrezza commented Jan 27, 2026

@hajjarjoseph it worked, thanks. It's indeed a pain to have these dependencies. We should move Parse.Error out of the parse repo into a distinct repo. That is in most cases the reason why parse is a dependency, like of the push adapter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:released-alpha Released as alpha version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants