Skip to content

Conversation

@kirkmorrow
Copy link
Contributor

@kirkmorrow kirkmorrow commented Dec 2, 2025

Part 2 of 2 fixes to address issue #1042
PR for part 1 is #1090

Pull Request

Issue

Closes: #1042

This is part 2 of 2 required for this fix. The Dart package update will need to be committed first. Then this PR will need to update pubspec.yaml to use that new package before this can be merged.

Approach

Use new ethernet enum to return a connection type consistent with connectivity_plus.

Tasks

  • [ No] Add tests
    • Not much to test here
  • [No ] Add changes to documentation (guides, repository pages, code comments)
    • No existing documentation to update, changes are consistent with existing code

Summary by CodeRabbit

  • New Features
    • Connectivity detection now uses a deterministic priority: Wi‑Fi > Ethernet > Mobile > None for both checks and live updates.
  • Tests
    • Added comprehensive tests with a mock connectivity provider to validate mapping, priority order, and edge cases.
  • Chores
    • Updated SDK dependency constraint and added a connectivity-related dev dependency.

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

Part 2 of 2 fixes to address issue parse-community#1042
Copilot AI review requested due to automatic review settings December 2, 2025 15:46
@parse-github-assistant
Copy link

parse-github-assistant bot commented Dec 2, 2025

🚀 Thanks for opening this pull request!

@coderabbitai
Copy link

coderabbitai bot commented Dec 2, 2025

📝 Walkthrough

Walkthrough

Centralizes connectivity interpretation in a new helper _mapConnectivity(List<ConnectivityResult>), updates checkConnectivity() and connectivityStream to use it, bumps Flutter package constraints/dev-dependencies, and adds tests with a mock ConnectivityPlatform verifying mapping and stream behavior.

Changes

Cohort / File(s) Summary
Core Connectivity Implementation
packages/flutter/lib/parse_server_sdk_flutter.dart
Adds private helper _mapConnectivity(List<ConnectivityResult>) and updates checkConnectivity() and connectivityStream to delegate to it. Priority: wifi > ethernet > mobile > none; ethernet counted as online when wifi absent.
Dependencies
packages/flutter/pubspec.yaml
Bumps parse_server_sdk constraint to >=9.4.2 <10.0.0 and adds dev-dependency connectivity_plus_platform_interface: ^2.0.0.
Connectivity Tests
packages/flutter/test/parse_connectivity_implementation_test.dart
Adds MockConnectivityPlatform and tests for Parse().checkConnectivity() and Parse().connectivityStream, covering wifi, ethernet, mobile, none and priority rules (wifi > ethernet, ethernet > mobile).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify _mapConnectivity implements priority rules and ethernet-as-online behavior consistently with Windows/macOS edge cases.
  • Check tests correctly replace ConnectivityPlatform.instance, manage stream lifecycle (broadcast/close), and cover mixed-list inputs.
  • Confirm pubspec dependency bump and added dev-dependency do not conflict with existing constraints.

Possibly related PRs

Suggested reviewers

  • mtrezza

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing LiveQuery connectivity by recognizing ethernet as a valid connection state.
Description check ✅ Passed The description properly links to the related issue #1042, explains this is part 2 of a fix, describes the approach, and addresses the template tasks.
Linked Issues check ✅ Passed The PR implements the core fix from issue #1042 by treating ethernet as an online connection, ensuring LiveQuery receives correct connectivity state on Windows/macOS.
Out of Scope Changes check ✅ Passed All changes directly address the linked issue: refactoring connectivity logic into a helper, updating dependency constraints, and adding tests for the new behavior.
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 f57af7b and e8fe2d3.

📒 Files selected for processing (1)
  • packages/flutter/test/parse_connectivity_implementation_test.dart (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/flutter/test/parse_connectivity_implementation_test.dart
⏰ 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). (4)
  • 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

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.

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 PR adds support for the ethernet connectivity type to align with the connectivity_plus package, completing the fix for LiveQuery connectivity issues (issue #1042). This is part 2 of a two-part change that requires the Dart package update (PR #1090) to be merged first.

Key Changes:

  • Added ethernet connectivity checks to both checkConnectivity() and connectivityStream methods
  • Ethernet is prioritized between wifi and mobile in the connectivity type hierarchy

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

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 2, 2025
@mtrezza mtrezza added the type:bug Impaired feature or lacking behavior that is likely assumed label Dec 2, 2025
@parse-github-assistant
Copy link

The label type:bug cannot be used here.

@parse-github-assistant parse-github-assistant bot removed the type:bug Impaired feature or lacking behavior that is likely assumed label Dec 2, 2025
@codecov
Copy link

codecov bot commented Dec 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.75%. Comparing base (f76fde4) to head (e8fe2d3).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1091      +/-   ##
==========================================
+ Coverage   43.54%   43.75%   +0.21%     
==========================================
  Files          61       61              
  Lines        3587     3588       +1     
==========================================
+ Hits         1562     1570       +8     
+ Misses       2025     2018       -7     

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

@mtrezza mtrezza changed the title Use new ethernet enum fix: LiveQuery not working due to ethernet not recognized as connectivity state Dec 2, 2025
@mtrezza
Copy link
Member

mtrezza commented Dec 2, 2025

@kirkmorrow Does the PR title make sense?

@kirkmorrow
Copy link
Contributor Author

@mtrezza This is part 2 of the fix. Feel free to update the title, I just stole the title text from the original bug this addresses.

@kirkmorrow kirkmorrow requested a review from Copilot December 2, 2025 18:47
Copilot finished reviewing on behalf of kirkmorrow December 2, 2025 18:49
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 2 out of 2 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.

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 2, 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.

Copilot finished reviewing on behalf of kirkmorrow December 3, 2025 15:36
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.

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 3, 2025
mtrezza
mtrezza previously approved these changes Dec 3, 2025
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.

Is this ready for merge?

@kirkmorrow
Copy link
Contributor Author

Is this ready for merge?

I'm taking another look at testing to cover the coverage complaints. I'll let you know when I'm done.

Eliminate duplicated code with helper function
@kirkmorrow kirkmorrow dismissed stale reviews from mtrezza and coderabbitai[bot] via 1edf729 December 3, 2025 16:31
@kirkmorrow
Copy link
Contributor Author

Okay... let's see how happy the AI bots are with these changes.

@kirkmorrow kirkmorrow requested a review from Copilot December 3, 2025 16:31
Copilot finished reviewing on behalf of kirkmorrow December 3, 2025 16:33
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.

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 3, 2025
@kirkmorrow
Copy link
Contributor Author

Darn it... I forgot to run "dart format" and made a second commit. However, it looks like the tests only ran on the first commit. @mtrezza can you force those tests to run again?

@kirkmorrow
Copy link
Contributor Author

If those test pass on re-run then I'm ready to merge.

@mtrezza
Copy link
Member

mtrezza commented Dec 3, 2025

Re-running...

info • The import of 'package:connectivity_plus/connectivity_plus.dart' is unnecessary because all of the used elements are also provided by the import of 'package:connectivity_plus_platform_interface/connectivity_plus_platform_interface.dart' • packages/flutter/test/parse_connectivity_implementation_test.dart:3:8 • unnecessary_import

@kirkmorrow
Copy link
Contributor Author

Looks like it's finally ready for merge.

@kirkmorrow kirkmorrow requested a review from Copilot December 3, 2025 20:22
Copilot finished reviewing on behalf of kirkmorrow December 3, 2025 20:24
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.

@mtrezza mtrezza merged commit 60520d6 into parse-community:master Dec 3, 2025
19 checks passed
parseplatformorg pushed a commit that referenced this pull request Dec 3, 2025
# [flutter-v10.6.1](flutter-10.6.0...flutter-10.6.1) (2025-12-03)

### Bug Fixes

* LiveQuery not working due to ethernet not recognized as connectivity state ([#1091](#1091)) ([60520d6](60520d6))
@parseplatformorg
Copy link

🎉 This change has been released in version flutter-v10.6.1

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: LiveQuery not working since 9.0.0

3 participants