Skip to content
This repository was archived by the owner on Jan 6, 2026. It is now read-only.

Comments

fix: recover faster after network outage (fixes #49)#131

Merged
bajtos merged 10 commits intoCheckerNetwork:mainfrom
Hany-Almnaem:fix-fast-recovery-offline
Jun 23, 2025
Merged

fix: recover faster after network outage (fixes #49)#131
bajtos merged 10 commits intoCheckerNetwork:mainfrom
Hany-Almnaem:fix-fast-recovery-offline

Conversation

@Hany-Almnaem
Copy link
Contributor

This PR improves SPARK's ability to recover quickly after network outages.

Changes:

  • Introduces ActivityState.isHealthy() to expose health state
  • Modifies spark.js#run() to:
    • Retry every 5 seconds when offline (OFFLINE_RETRY_DELAY_MS)
    • Use jittered delay when healthy (via calculateDelayBeforeNextTask)
  • Adds a test case to verify offline retry delay

This makes the station feel more responsive after waking from sleep or reconnecting.

All tests pass
Fixes #49

Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

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

Thank you for the pull request, @Hany-Almnaem! This will be a great and impactful improvement. ❤️

Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

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

Almost there!

@bajtos bajtos merged commit 3c5219c into CheckerNetwork:main Jun 23, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this to ✅ done in CheckerNetwork Jun 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

Status: ✅ done

Development

Successfully merging this pull request may close these issues.

Recover faster after network outage

2 participants