Skip to content

Conversation

@mtrezza
Copy link
Member

@mtrezza mtrezza commented Nov 7, 2025

Pull Request

Issue

MongoDB driver options serverSelectionTimeoutMS, maxIdleTimeMS, heartbeatFrequencyMS not recognized.

Approach

Add support for MongoDB driver options serverSelectionTimeoutMS, maxIdleTimeMS, heartbeatFrequencyMS.

Tasks

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

Summary by CodeRabbit

  • New Features
    • Added serverSelectionTimeoutMS option to configure the server selection timeout duration in milliseconds.
    • Added maxIdleTimeMS option to specify the maximum idle time for connections in the connection pool before removal.
    • Added heartbeatFrequencyMS option to control how frequently the driver checks MongoDB deployment state.

@parse-github-assistant
Copy link

parse-github-assistant bot commented Nov 7, 2025

🚀 Thanks for opening this pull request!

@coderabbitai
Copy link

coderabbitai bot commented Nov 7, 2025

📝 Walkthrough

Walkthrough

Adds three MongoDB driver options—serverSelectionTimeoutMS, maxIdleTimeMS, and heartbeatFrequencyMS—across tests, option definitions, documentation, Flow and TypeScript type declarations, and environment variable parsing.

Changes

Cohort / File(s) Summary
Test Updates
spec/ParseConfigKey.spec.js
Added serverSelectionTimeoutMS, maxIdleTimeMS, and heartbeatFrequencyMS as valid MongoDB database configuration options in the databaseOptions test path; test asserts no invalidKey errors.
Option Definitions
src/Options/Definitions.js
Inserted three new DatabaseOptions properties with env names (PARSE_SERVER_DATABASE_SERVER_SELECTION_TIMEOUT_MS, PARSE_SERVER_DATABASE_MAX_IDLE_TIME_MS, PARSE_SERVER_DATABASE_HEARTBEAT_FREQUENCY_MS) and parsers.numberParser(...) for each, plus help text.
JSDoc Documentation
src/Options/docs.js
Added JSDoc entries documenting serverSelectionTimeoutMS, maxIdleTimeMS, and heartbeatFrequencyMS (Number, ms) on DatabaseOptions.
Flow Type Definitions
src/Options/index.js
Added optional numeric fields serverSelectionTimeoutMS, maxIdleTimeMS, and heartbeatFrequencyMS to the DatabaseOptions Flow type.
TypeScript Type Definitions
types/Options/index.d.ts
Added optional numeric properties serverSelectionTimeoutMS?: number, maxIdleTimeMS?: number, and heartbeatFrequencyMS?: number to the DatabaseOptions interface.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

  • Verify environment variable names and help text match across files.
  • Confirm numeric parsers are used consistently and handle edge cases.
  • Ensure Flow and TypeScript declarations align with the runtime option keys.
  • Validate the updated test correctly covers the new keys.

Suggested reviewers

  • Moumouls

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description identifies the problem and approach but lacks specific issue link and does not indicate whether tests have been added despite the unchecked test task. Add the GitHub issue number/link in the 'Closes' field and provide clarity on test coverage status, as the 'Add tests' checkbox remains unchecked.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding support for three MongoDB driver options with their exact names.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 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.

@parseplatformorg
Copy link
Contributor

parseplatformorg commented Nov 7, 2025

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.

@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.06%. Comparing base (460a65c) to head (a265932).
⚠️ Report is 3 commits behind head on alpha.

Additional details and impacted files
@@           Coverage Diff           @@
##            alpha    #9910   +/-   ##
=======================================
  Coverage   93.06%   93.06%           
=======================================
  Files         187      187           
  Lines       15187    15187           
  Branches      177      177           
=======================================
  Hits        14134    14134           
  Misses       1041     1041           
  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 merged commit 1b661e9 into parse-community:alpha Nov 7, 2025
25 of 27 checks passed
parseplatformorg pushed a commit that referenced this pull request Nov 7, 2025
# [8.5.0-alpha.2](8.5.0-alpha.1...8.5.0-alpha.2) (2025-11-07)

### Features

* Add support for MongoDB driver options `serverSelectionTimeoutMS`, `maxIdleTimeMS`, `heartbeatFrequencyMS` ([#9910](#9910)) ([1b661e9](1b661e9))
@parseplatformorg
Copy link
Contributor

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

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Nov 7, 2025
@mtrezza mtrezza deleted the feat/mongo-options branch November 7, 2025 19:43
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.

2 participants