Skip to content

Conversation

swittk
Copy link
Contributor

@swittk swittk commented Sep 20, 2025

Pull Request

Issue

FetchOptions should be an optional parameter same as before the V6 changes. The ObjectController downstream already handles this parameter as optional.

Closes: #2725

Approach

Adds the optionality to the typescript type.

Tasks

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

Summary by CodeRabbit

  • New Features

    • You can now call object fetch without passing options; the options parameter is optional for a simpler API.
    • No behavior changes—existing usage continues to work as before.
  • TypeScript

    • Updated type definitions to reflect the optional options parameter in fetch.

FetchOptions should be an optional parameter same as before the V6 changes. The ObjectController downstream already handles this parameter as optional.
Copy link

parse-github-assistant bot commented Sep 20, 2025

🚀 Thanks for opening this pull request!

@parseplatformorg
Copy link
Contributor

parseplatformorg commented Sep 20, 2025

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

security/snyk check is complete. No issues have been found. (View Details)

@swittk swittk changed the title Update ParseObject.ts Types : Update ParseObject.ts Sep 20, 2025
@swittk swittk changed the title Types : Update ParseObject.ts fix : Update ParseObject.ts Sep 20, 2025
@swittk swittk changed the title fix : Update ParseObject.ts fix: Update ParseObject.ts Sep 20, 2025
Copy link

codecov bot commented Sep 20, 2025

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##             alpha     #2726   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           63        63           
  Lines         6185      6185           
  Branches      1472      1460   -12     
=========================================
  Hits          6185      6185           

☔ 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 fix: Update ParseObject.ts fix: Incorrect type in ParseObject.fetch parameter options Sep 21, 2025
@mtrezza
Copy link
Member

mtrezza commented Sep 21, 2025

Could you please take a look at https://github.com/parse-community/Parse-SDK-JS/blob/alpha/CONTRIBUTING.md#typescript-tests for type modifications to fix the failing test.

Copy link

coderabbitai bot commented Sep 30, 2025

📝 Walkthrough

Walkthrough

Makes the ParseObject.fetch method’s options parameter optional in both implementation (src/ParseObject.ts) and type declarations (types/ParseObject.d.ts). No other logic or control flow changes.

Changes

Cohort / File(s) Change Summary
ParseObject fetch signature
src/ParseObject.ts, types/ParseObject.d.ts
Updated method signature from fetch(options: FetchOptions) to fetch(options?: FetchOptions); retains existing fetch flow and request option handling.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly and concisely summarizes the primary change by indicating a fix to the incorrect type of the ParseObject.fetch options parameter, directly reflecting the core modification in the pull request.
Linked Issues Check ✅ Passed The changes update both the implementation and type declaration of ParseObject.fetch to make its options parameter optional, precisely satisfying the requirement from issue #2725 to restore the previous optionality of that parameter.
Out of Scope Changes Check ✅ Passed All modifications are limited to changing the fetch method signature in the source and corresponding declaration file, with no extraneous alterations unrelated to restoring the optional options parameter.
Description Check ✅ Passed The description follows the repository template by including security and license notices, linking to the issue it closes, detailing the issue and its resolution under “Issue,” summarizing the implementation under “Approach,” and listing tasks to add tests and documentation.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6941012 and 3e85bdb.

📒 Files selected for processing (2)
  • src/ParseObject.ts (1 hunks)
  • types/ParseObject.d.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build (Node 22, 22.4.1)
🔇 Additional comments (2)
src/ParseObject.ts (1)

1253-1253: LGTM! Parameter is now optional as intended.

The change correctly restores optionality for the options parameter. The implementation safely handles undefined via the default parameter in _getRequestOptions (line 515), ensuring backward and forward compatibility.

types/ParseObject.d.ts (1)

451-451: LGTM! Type declaration now matches implementation.

The type declaration correctly reflects the optional parameter, aligning with the implementation change in src/ParseObject.ts and resolving the type error described in issue #2725.


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
🧪 Early access (Sonnet 4.5): enabled

We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

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

@swittk
Copy link
Contributor Author

swittk commented Sep 30, 2025

Sorry; didn't get to it. Reran types now.

@swittk
Copy link
Contributor Author

swittk commented Oct 3, 2025

Hi, @mtrezza is this good to go?

Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

Looks good!

@mtrezza mtrezza merged commit dc78419 into parse-community:alpha Oct 3, 2025
13 checks passed
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.

Parse.Object fetch() incorrect type.
3 participants