Skip to content

[#71] 🐌 Slow connection detection#119

Draft
LahaLuhem wants to merge 4 commits intoOutdatedGuy:mainfrom
LahaLuhem:feature/99-🐌-slow-connection-detection

Hidden character warning

The head ref may contain hidden characters: "feature/99-\ud83d\udc0c-slow-connection-detection"
Draft

[#71] 🐌 Slow connection detection#119
LahaLuhem wants to merge 4 commits intoOutdatedGuy:mainfrom
LahaLuhem:feature/99-🐌-slow-connection-detection

Conversation

@LahaLuhem
Copy link
Copy Markdown

@LahaLuhem LahaLuhem commented Jan 21, 2026

This builds on #118 to implement #71.

Summary of changes

  1. Added SlowConnectionConfig class
    • Use to configure the 'what is slow'
  2. Updated InternetCheckResult to include responseTime field
    • Will be used to track the timing of the response of the result
  3. Implementation in InternetConnection
    • Modified _checkReachabilityFor to measure and record response time
    • Updated internetStatus getter to check for slow connections when config is provided
    • Added two new methods for slow detection in both strict and non-strict modes
      1. _internetStatusWithSlowDetectionStrict(): Checks if all endpoints are successful, then checks if any are slow
      2. _internetStatusWithSlowDetectionNonStrict(): Checks for any successful endpoint, returns connected if fast connection found, slow if only slow connections found

Summary of behaviour

This makes the final behaviour as follows

  • When slowConnectionConfig is null: Behaves as before with just connected/disconnected
  • When slowConnectionConfig is provided
    • In strict mode: All endpoints must succeed. If any successful response exceeds the threshold, status is slow
    • In non-strict mode: Returns connected as soon as a fast connection is found, slow if only slow connections found, disconnected if none succeed
    • hasInternetAccess still returns true for both connected and slow statuses

Left to do

  1. Add new unit tests for the slow detection

@LahaLuhem LahaLuhem changed the title #99 🐌 Slow connection detection #71 🐌 Slow connection detection Jan 21, 2026
@LahaLuhem LahaLuhem changed the title #71 🐌 Slow connection detection [#71] 🐌 Slow connection detection Jan 21, 2026
@LahaLuhem LahaLuhem closed this Jan 21, 2026
@LahaLuhem LahaLuhem deleted the feature/99-🐌-slow-connection-detection branch January 21, 2026 11:23
@LahaLuhem LahaLuhem restored the feature/99-🐌-slow-connection-detection branch January 21, 2026 11:24
@LahaLuhem LahaLuhem reopened this Jan 21, 2026
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.

1 participant