Skip to content

Conversation

@kirkmorrow
Copy link
Contributor

@kirkmorrow kirkmorrow commented Dec 2, 2025

Provides better alignment with newer version of connectivity_plus Add basic testing
Part 1 of 2 to fix Issue #1042
Part 2 PR is #1091

Pull Request

Issue

#1042

Closes: This is only part 1 of 2 required to fix this. This change to the Dart package must be commit with a new version number before the second part in the Flutter package can be applied.

Approach

Adds ethernet to enum to be consistent with connectivity_plus package that this code depends on.

Tasks

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

Summary by CodeRabbit

  • New Features

    • Added Ethernet as a recognized connectivity state, enabling detection of wired network connections alongside Wi‑Fi, mobile, and offline modes.
    • Improved connectivity streaming to reflect state transitions including the new Ethernet state.
  • Tests

    • Added comprehensive tests covering all connectivity states and stream emissions, verifying transitions and real‑time updates.

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

Provides better alignment with newer version of connectivity_plus
Add basic testing
Part 1 of 2 to fix Issue parse-community#1042
Copilot AI review requested due to automatic review settings December 2, 2025 15:36
@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

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 an ethernet value to the ParseConnectivityResult enum and introduces unit tests (with a MockConnectivityProvider) that exercise connectivity states including wifi, ethernet, mobile, and none, plus stream emission verification.

Changes

Cohort / File(s) Summary
Connectivity enum enhancement
packages/dart/lib/src/network/parse_connectivity.dart
Added ethernet enum value to ParseConnectivityResult, positioned after wifi and before mobile.
Connectivity state testing
packages/dart/test/src/network/parse_live_query_test.dart
Added MockConnectivityProvider test helper and new "Connectivity handling" test group that checks checkConnectivity results for wifi, ethernet, mobile, none and validates connectivity stream emissions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Review the enum addition for ordering and public API implications.
  • Inspect MockConnectivityProvider for correct stream behavior and resource disposal in tests.
  • Verify tests properly assert emitted sequence and timing (flaky-timing risk).

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description covers the main approach and links to the relevant issue, but deviates from the template structure and contains formatting inconsistencies.
Title check ✅ Passed The title 'fix: Ethernet not recognized as connectivity state' accurately describes the main change: adding ethernet to the ParseConnectivityResult enum to fix connectivity recognition.
✨ 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.

Copilot finished reviewing on behalf of kirkmorrow December 2, 2025 15:38
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 ethernet to the ParseConnectivityResult enum in the dart package to align with the newer version of connectivity_plus package. This is Part 1 of a 2-part fix for LiveQuery connectivity issues (#1042).

  • Adds ethernet enum value to ParseConnectivityResult
  • Includes basic connectivity tests using a mock provider
  • Maintains backward compatibility with existing LiveQuery reconnection logic

Reviewed changes

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

File Description
packages/dart/lib/src/network/parse_connectivity.dart Adds ethernet enum value with documentation to ParseConnectivityResult
packages/dart/test/src/network/parse_live_query_test.dart Adds MockConnectivityProvider and tests for all connectivity states including ethernet

💡 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/dart/test/src/network/parse_live_query_test.dart (1)

90-187: LGTM! Comprehensive coverage of connectivity states.

The test cases effectively verify handling of all connectivity states (wifi, ethernet, mobile, none) including the newly added ethernet support. The test structure is clear and consistent.

Optional: Consider verifying Parse reinitialization behavior.

Each test calls Parse().initialize() without explicit cleanup. If Parse maintains global state, consider verifying that repeated initialization doesn't cause issues, or add cleanup to ensure test isolation. This may already work correctly if Parse handles reinitialization gracefully.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ab3974 and b79d9b1.

📒 Files selected for processing (2)
  • packages/dart/lib/src/network/parse_connectivity.dart (1 hunks)
  • packages/dart/test/src/network/parse_live_query_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). (1)
  • GitHub Check: Agent
🔇 Additional comments (3)
packages/dart/lib/src/network/parse_connectivity.dart (1)

8-10: LGTM! Clean enum addition.

The ethernet enum value is properly documented and logically positioned. This change successfully extends connectivity detection to support Ethernet connections as described in the PR objectives.

packages/dart/test/src/network/parse_live_query_test.dart (2)

9-31: LGTM! Well-designed mock implementation.

The MockConnectivityProvider correctly implements the ParseConnectivityProvider interface with appropriate use of a broadcast stream and proper resource cleanup.


189-224: LGTM! Stream emission test is well-structured.

The test correctly verifies that connectivity state changes are emitted through the stream in the expected order, with proper subscription cleanup to prevent resource leaks.

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 2, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 2, 2025
@kirkmorrow kirkmorrow requested a review from Copilot December 2, 2025 15:50
Copilot finished reviewing on behalf of kirkmorrow December 2, 2025 15:52
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 1 comment.


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

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.

@mtrezza mtrezza changed the title Add ethernet to ParseConnectivityResult fix: Add ethernet to ParseConnectivityResult 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.51%. Comparing base (6b9ef6b) to head (312926c).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1090      +/-   ##
==========================================
+ Coverage   43.46%   43.51%   +0.05%     
==========================================
  Files          61       61              
  Lines        3587     3587              
==========================================
+ Hits         1559     1561       +2     
+ Misses       2028     2026       -2     

☔ 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 fix: Add ethernet to ParseConnectivityResult fix: Ethernet not a recognized connectivity state Dec 2, 2025
@mtrezza mtrezza changed the title fix: Ethernet not a recognized connectivity state fix: Ethernet not recognized as connectivity state Dec 2, 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.

Let me know when this is ready for merge.

@kirkmorrow
Copy link
Contributor Author

@mtrezza I'm ready to merge if you are.

@mtrezza mtrezza merged commit f76fde4 into parse-community:master Dec 2, 2025
19 checks passed
parseplatformorg pushed a commit that referenced this pull request Dec 2, 2025
# [dart-v9.4.2](dart-9.4.1...dart-9.4.2) (2025-12-02)

### Bug Fixes

* Ethernet not recognized as connectivity state ([#1090](#1090)) ([f76fde4](f76fde4))
@parseplatformorg
Copy link

🎉 This change has been released in version dart-v9.4.2

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.

3 participants