Skip to content

Feat/health check auto disable#722

Merged
RUKAYAT-CODER merged 2 commits into
rinafcode:mainfrom
Jay-dev57:feat/health-check-auto-disable
Jun 28, 2026
Merged

Feat/health check auto disable#722
RUKAYAT-CODER merged 2 commits into
rinafcode:mainfrom
Jay-dev57:feat/health-check-auto-disable

Conversation

@Jay-dev57

Copy link
Copy Markdown

What this PR does
Implements automatic feature flag toggling based on health check results.
When a monitored service is degraded, its dependent feature flag is
automatically disabled so users see a graceful fallback instead of errors.
When the service recovers, the flag is re-enabled automatically.

Changes

  • src/config/degradationConfig.ts (new) — defines HEALTH_TO_FEATURE_MAP
    mapping services to their feature flags, and isServiceDegraded() helper
  • src/store/healthDashboardStore.ts (updated) — setSnapshot() now accepts
    optional service health statuses and applies degradation flags after each
    health check cycle. Adds selectIsServiceDegraded() selector for fallback UI.
  • tests/store/healthDashboardStore.test.ts** (new) — 11 tests covering the
    full degradation → fallback → recovery → re-enable cycle

How it works

  • Streaming degraded → streaming_courses flag disabled → user sees static content
  • Payment degraded → payment_form flag disabled → user sees unavailable message
  • Service recovers → flag re-enabled within one polling cycle (≤ 10 seconds)
  • Admin can set adminOverride: true in the config to block automatic changes

Tests
All 11 tests pass:

  • pnpm test tests/store/healthDashboardStore.test.ts

Closes #665

Dataguru-tech added 2 commits June 28, 2026 07:45
- Define HEALTH_TO_FEATURE_MAP in src/config/degradationConfig.ts
- Update setSnapshot() to apply degradation flags after each health cycle
- Add selectIsServiceDegraded selector for fallback UI
- Add full test suite: degradation, fallback, recovery, admin override
- Define HEALTH_TO_FEATURE_MAP in src/config/degradationConfig.ts
- Update setSnapshot() to apply degradation flags after each health cycle
- Add selectIsServiceDegraded selector for fallback UI
- Add full test suite: degradation, fallback, recovery, admin override
@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@Jay-dev57 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Thank you for contributing to the project.

@RUKAYAT-CODER RUKAYAT-CODER merged commit 0e62a76 into rinafcode:main Jun 28, 2026
2 of 13 checks passed
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.

[Enhancement] Add health check endpoint monitoring with feature flag auto-disable on degradation

2 participants