Skip to content

Conversation

@cryptodev-2s
Copy link
Contributor

@cryptodev-2s cryptodev-2s commented Jan 20, 2026

Explanation

This PR introduces an init() method to the ConnectivityController that asynchronously fetches the initial connectivity status from the adapter. The constructor now initializes with a default state (online) instead of synchronously calling getStatus(), enabling better async initialization patterns.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Introduces asynchronous initialization and updates adapter contract.

  • New: init() fetches initial status via adapter and updates state; controller now starts with default online state
  • Changed (BREAKING): ConnectivityAdapter.getStatus() now returns Promise<ConnectivityStatus>
  • Subscribes to adapter changes using onConnectivityChangesetConnectivityStatus
  • Tests updated to reflect async getStatus and new initialization flow; changelog updated

Written by Cursor Bugbot for commit 742e048. This will update automatically on new commits. Configure here.

@cryptodev-2s cryptodev-2s self-assigned this Jan 20, 2026
@cryptodev-2s cryptodev-2s force-pushed the add-connectivity-controller-init-method branch from 6b4769b to 942fa1e Compare January 20, 2026 20:54
@cryptodev-2s cryptodev-2s marked this pull request as ready for review January 20, 2026 20:54
@cryptodev-2s cryptodev-2s requested a review from a team as a code owner January 20, 2026 20:54
- Add init() method to asynchronously fetch initial connectivity status
- Change constructor to initialize with default state instead of calling getStatus
- Store connectivityAdapter as private field
- Update ConnectivityAdapter.getStatus() to return Promise<ConnectivityStatus>
- Update tests to reflect new initialization pattern
- Add comprehensive tests for init() method
- Update CHANGELOG with new features and breaking changes
@cryptodev-2s cryptodev-2s force-pushed the add-connectivity-controller-init-method branch from 942fa1e to 61401be Compare January 20, 2026 20:56
@cryptodev-2s cryptodev-2s requested a review from mcmire January 20, 2026 20:56
- Remove duplicate offline test that was already covered by the comprehensive first test
- Remove online test that didn't verify init() worked (default state is already online)
- Keep only meaningful tests that verify actual behavior
Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

LGTM.

@cryptodev-2s cryptodev-2s added this pull request to the merge queue Jan 20, 2026
Merged via the queue into main with commit 7251544 Jan 20, 2026
298 checks passed
@cryptodev-2s cryptodev-2s deleted the add-connectivity-controller-init-method branch January 20, 2026 22:17
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.

3 participants