Skip to content

Conversation

@kirkmorrow
Copy link
Contributor

@kirkmorrow kirkmorrow commented Dec 11, 2025

Pull Request

Issue

Closes: #1043

Approach

This PR exposes the retry configuration parameters in the Flutter package wrapper to match the functionality already available in the Dart package (v9.5.0).

Changes:

  • Added restRetryIntervals parameter to Parse.initialize() in the Flutter package
  • Added restRetryIntervalsForWrites parameter to Parse.initialize() in the Flutter package
  • Both parameters are forwarded to the underlying Dart package initialization
  • No changes to retry logic itself, which was already implemented in the Dart package v9.5.0

This allows Flutter developers to configure automatic retry behavior for REST API requests, including separate retry configurations for read operations (GET, DELETE) versus write operations (POST, PUT).

Tasks

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

Summary by CodeRabbit

  • New Features

    • Added configurable REST retry intervals with separate settings for write operations; existing defaults preserved.
  • Chores

    • Bumped core SDK dependency constraint to require 9.5.0+.
  • Tests

    • Added/updated tests verifying retry-interval configuration (including write-specific intervals) and default behavior.

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

Copilot AI review requested due to automatic review settings December 11, 2025 13:22
@parse-github-assistant
Copy link

parse-github-assistant bot commented Dec 11, 2025

🚀 Thanks for opening this pull request!

@coderabbitai
Copy link

coderabbitai bot commented Dec 11, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Adds two optional parameters (restRetryIntervals, restRetryIntervalsForWrites) to Parse.initialize in the Flutter package, forwards them to super.initialize, updates tests to pass and assert those values (including defaults), and bumps the parse_server_sdk dependency to >=9.5.0 <10.0.0.

Changes

Cohort / File(s) Summary
Parse initialization signature & forwarding
packages/flutter/lib/parse_server_sdk_flutter.dart
Added optional named parameters List<int>? restRetryIntervals and List<int>? restRetryIntervalsForWrites to Parse.initialize, updated documentation comments, and forwarded them to super.initialize.
Tests updated
packages/flutter/test/parse_client_configuration_test.dart
Updated tests to call Parse.initialize with restRetryIntervals and restRetryIntervalsForWrites, added assertions verifying ParseCoreData().restRetryIntervals and ...ForWrites, and added a test asserting default values when omitted.
Dependency bump
packages/flutter/pubspec.yaml
Updated parse_server_sdk dependency constraint from >=9.4.2 <10.0.0 to >=9.5.0 <10.0.0.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Focus areas:
    • packages/flutter/lib/parse_server_sdk_flutter.dart — confirm new parameters, doc comments, and correct forwarding to super.initialize.
    • packages/flutter/test/parse_client_configuration_test.dart — verify tests set and assert values (including defaults) deterministically.
    • packages/flutter/pubspec.yaml — ensure dependency bump aligns with the core changes.

Possibly related PRs

Suggested reviewers

  • mtrezza
  • mbfakourii

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly summarizes the main change: adding client-to-server request retry parameter support to the Flutter SDK, which matches the primary objective of exposing retry configuration parameters.
Description check ✅ Passed The description follows the template structure, includes the issue link (#1043), clearly explains the approach and changes made, and indicates that tests and documentation were added.
Linked Issues check ✅ Passed The PR successfully exposes retry parameters (restRetryIntervals and restRetryIntervalsForWrites) in the Flutter wrapper, enabling developers to configure automatic retry behavior for REST requests as requested in issue #1043.
Out of Scope Changes check ✅ Passed All changes directly support the objective of exposing retry configuration parameters: updating the Flutter SDK's Parse.initialize() method, adding test coverage, updating the pubspec.yaml dependency, and documenting the new parameters.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • 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 ec1a67a and da94717.

📒 Files selected for processing (1)
  • packages/flutter/test/parse_client_configuration_test.dart (3 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). (5)
  • GitHub Check: Test Flutter beta
  • GitHub Check: Test Flutter 3.38, Windows
  • GitHub Check: Test Flutter 3.38, macOS
  • GitHub Check: Test Flutter 3.38, Ubuntu
  • GitHub Check: Test Flutter 3.38, Ubuntu, WASM
🔇 Additional comments (3)
packages/flutter/test/parse_client_configuration_test.dart (3)

6-6: LGTM!

The addition of TestWidgetsFlutterBinding.ensureInitialized() is appropriate for Flutter tests that interact with the Flutter binding.


23-24: LGTM!

The new retry parameters are correctly passed to Parse().initialize() and properly asserted in ParseCoreData(). Test values are appropriate for verifying parameter forwarding.

Also applies to: 39-40


43-70: No changes needed—test correctly verifies defaults.

The hardcoded default values [0, 250, 500, 1000, 2000] and <int>[] match the documented SDK defaults (lines 57–60 of packages/dart/lib/src/data/parse_core_data.dart). Test isolation is not a concern because ParseCoreData.init() creates a fresh singleton instance on each initialize() call and applies defaults via null coalescing when parameters are omitted. The second test will not inherit state from the first.


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.

@codecov
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.37%. Comparing base (bbfcb07) to head (da94717).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1103   +/-   ##
=======================================
  Coverage   44.37%   44.37%           
=======================================
  Files          62       62           
  Lines        3727     3727           
=======================================
  Hits         1654     1654           
  Misses       2073     2073           

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

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request exposes retry configuration parameters for REST API requests in the Flutter SDK wrapper to match functionality already available in the underlying Dart package (v9.5.0). This allows Flutter developers to configure automatic retry behavior for failed HTTP requests, with separate configurations for read operations (GET, DELETE) versus write operations (POST, PUT).

  • Updated dependency constraint to require Dart SDK v9.5.0 or higher
  • Added restRetryIntervals and restRetryIntervalsForWrites parameters to Parse.initialize()
  • Both parameters are forwarded to the underlying Dart package without modification

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/flutter/pubspec.yaml Updates minimum Dart SDK version from 9.4.2 to 9.5.0 to support retry configuration
packages/flutter/lib/parse_server_sdk_flutter.dart Adds restRetryIntervals and restRetryIntervalsForWrites parameters to Parse.initialize() method and forwards them to the underlying Dart SDK

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/flutter/lib/parse_server_sdk_flutter.dart (1)

69-71: New retry interval parameters are correctly threaded through; consider documenting them

The additions of restRetryIntervals and restRetryIntervalsForWrites to Parse.initialize and their direct forwarding to super.initialize look consistent and should be behavior‑preserving for existing callers while exposing the new configuration surface. Nice, minimal wiring change.

As a small follow‑up, consider:

  • Updating the method doc comment (and/or user‑facing docs) to briefly describe what these lists represent (units, example values, default behavior when null).
  • Verifying the parameter names, types, and ordering still exactly match sdk.Parse.initialize in parse_server_sdk ≥9.5.0 so the @override remains valid over time.

Also applies to: 107-109

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bbfcb07 and a3b1cc1.

📒 Files selected for processing (2)
  • packages/flutter/lib/parse_server_sdk_flutter.dart (2 hunks)
  • packages/flutter/pubspec.yaml (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). (7)
  • GitHub Check: Agent
  • GitHub Check: Test Flutter 3.38, Ubuntu, WASM
  • GitHub Check: Test Flutter 3.38, Windows
  • GitHub Check: Test Flutter beta
  • GitHub Check: Test Flutter 3.38, macOS
  • GitHub Check: Test Dart 3.10, Windows
  • GitHub Check: Test Flutter 3.38, Ubuntu
🔇 Additional comments (1)
packages/flutter/pubspec.yaml (1)

28-28: Dependency constraint bump correctly aligned with new retry parameters

Raising parse_server_sdk to >=9.5.0 <10.0.0 is the right move so the new restRetryIntervals* named parameters exist on sdk.Parse.initialize. As long as CI passes against 9.5.x and release notes mention this min-version change, this looks good to ship.

Please double-check against the parse_server_sdk 9.5.x changelog that there are no other breaking behavior changes for APIs used by this Flutter wrapper.

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 11, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/flutter/test/parse_client_configuration_test.dart (1)

22-23: New retry interval fields are correctly exercised in tests

Passing restRetryIntervals / restRetryIntervalsForWrites through Parse().initialize and asserting them on ParseCoreData gives solid wiring coverage and addresses the previous “missing tests” concern.

If you want to go a step further, you could add a second test case that omits these parameters to implicitly assert the SDK’s default behavior, but that’s optional and not a blocker.

Also applies to: 38-39

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a3b1cc1 and fc8a38b.

📒 Files selected for processing (2)
  • packages/flutter/lib/parse_server_sdk_flutter.dart (3 hunks)
  • packages/flutter/test/parse_client_configuration_test.dart (2 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). (6)
  • GitHub Check: Test Flutter 3.38, Ubuntu, WASM
  • GitHub Check: Test Flutter 3.38, Windows
  • GitHub Check: Test Flutter beta
  • GitHub Check: Test Flutter 3.38, macOS
  • GitHub Check: Test Flutter 3.38, Ubuntu
  • GitHub Check: Test Dart 3.10, Windows
🔇 Additional comments (2)
packages/flutter/lib/parse_server_sdk_flutter.dart (2)

50-59: Retry parameter documentation is clear and developer-friendly

The added doc comments for restRetryIntervals and restRetryIntervalsForWrites clearly describe scope (read vs write operations), units, defaults, and the idempotency caveat. This is exactly the kind of detail Flutter users need at the wrapper level.


79-80: Retry parameters are correctly threaded through to the base SDK; keep in sync with upstream signature

The new restRetryIntervals / restRetryIntervalsForWrites named parameters in Parse.initialize and their forwarding to super.initialize look correct and non-invasive; they preserve existing behavior when left null and let the underlying SDK own the defaults.

Going forward, it would be good to treat this override as mirroring the base SDK’s initialize signature and review it whenever the upstream API changes, to avoid subtle drift (e.g., new retry-related fields or changed semantics).

Also applies to: 117-118

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 11, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/flutter/test/parse_client_configuration_test.dart (1)

42-62: Default-values regression test is solid; minor intent and coupling nits.

This test nicely guards default behavior for debug, session handling, and the new retry lists, including ensuring writes default to an empty list. Two small suggestions: (1) the comment “only required parameters” is slightly misleading since appName, appPackageName, and appVersion are also provided—either adjust the comment or assert those fields as well; and (2) since the expected retry defaults mirror constants from the core Dart SDK, be aware this test will need updating if upstream changes those defaults.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fc8a38b and ec1a67a.

📒 Files selected for processing (1)
  • packages/flutter/test/parse_client_configuration_test.dart (2 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). (5)
  • GitHub Check: Test Flutter 3.38, Windows
  • GitHub Check: Test Flutter 3.38, Ubuntu
  • GitHub Check: Test Flutter 3.38, macOS
  • GitHub Check: Test Flutter beta
  • GitHub Check: Test Flutter 3.38, Ubuntu, WASM
🔇 Additional comments (1)
packages/flutter/test/parse_client_configuration_test.dart (1)

22-23: New retry interval assertions look correct; please confirm alignment with core SDK.

Passing restRetryIntervals / restRetryIntervalsForWrites here and asserting them via ParseCoreData() is a good, direct verification of the new plumbing from Flutter into the underlying SDK. Please double‑check that these fields map 1:1 (type and semantics, e.g. units and ordering) to the corresponding properties in parse_server_sdk v9.5.0 so the test won’t diverge from upstream behavior on future upgrades.

Also applies to: 38-39

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 11, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

Impliment automatic retry on response error

1 participant