Skip to content

ENG-9279: Add status to reflex.dev footer#6351

Draft
carlosabadia wants to merge 5 commits intomainfrom
carlos/add-status-to-footer
Draft

ENG-9279: Add status to reflex.dev footer#6351
carlosabadia wants to merge 5 commits intomainfrom
carlos/add-status-to-footer

Conversation

@carlosabadia
Copy link
Copy Markdown
Contributor

No description provided.

@linear
Copy link
Copy Markdown

linear Bot commented Apr 21, 2026

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 21, 2026

Merging this PR will not alter performance

✅ 9 untouched benchmarks


Comparing carlos/add-status-to-footer (72da4db) with main (060f9a2)

Open in CodSpeed

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 21, 2026

Greptile Summary

This PR adds a live service-status badge to both the reflex.dev site footer and the docs site footer, backed by a Checkly polling loop that updates a global CURRENT_STATUS every 60 seconds and exposes it via a @rx.var(interval=60) computed var.

  • P1 – Unconfigured credentials cause silent polling: When CHECKLY_API_KEY/CHECKLY_ACCOUNT_ID/CHECKLY_CHECK_GROUP_ID are empty (their defaults), monitor_checkly_status still fires HTTP requests to Checkly on every 60-second tick. Errors are swallowed by contextlib.suppress, so this is invisible but wastes resources in all non-production environments.
  • P1 – Module-level component instances shared across sites: STATUS_VARIANT_ICON creates rx.Component objects once at import time; the same Python objects are embedded in every server_status() call. Since the function is called in both footer.py and docpage.py, the same instances appear in two component trees, risking duplicate IDs or mis-patched state in Reflex's render diffing.

Confidence Score: 4/5

Safe to merge after addressing the credentials guard and module-level component-instance sharing.

Two P1 findings remain: unconfigured environments will silently fire failing HTTP requests every minute, and shared module-level component instances may cause Reflex rendering anomalies when the badge appears in multiple pages. Neither is data-loss or a security issue, but both should be fixed before shipping.

backend/status.py (credentials guard) and components/server_status.py (module-level component instances).

Important Files Changed

Filename Overview
packages/reflex-ui-shared/src/reflex_ui_shared/backend/status.py New file: Checkly polling loop and StatusState var — missing credentials guard causes silent no-op requests every 60s in unconfigured environments; Checkly API base URL hardcoded twice.
packages/reflex-ui-shared/src/reflex_ui_shared/components/server_status.py New file: Status badge component — module-level component instances shared across multiple call sites may produce duplicate IDs or mis-patched state in Reflex's diffing engine.
packages/reflex-ui-shared/src/reflex_ui_shared/constants.py Adds STATUS_WEB_URL and three Checkly credential constants sourced from environment variables with empty-string defaults.
packages/reflex-ui-shared/src/reflex_ui_shared/views/footer.py Integrates server_status badge into the main site footer alongside the copyright notice; adds h-fit to logo anchor for alignment.
docs/app/reflex_docs/templates/docpage/docpage.py Adds server_status badge to the docs-site footer using StatusState.status; wraps copyright and status in a flex row.
docs/app/reflex_docs/reflex_docs.py Registers monitor_checkly_status as a lifespan task on the docs app — straightforward integration.
packages/reflex-ui-shared/src/reflex_ui_shared/components/icons.py Adds a simple filled-circle SVG icon and registers it in the ICONS dict.

Sequence Diagram

sequenceDiagram
    participant App as Reflex App (lifespan)
    participant Mon as monitor_checkly_status()
    participant Checkly as Checkly API
    participant State as StatusState (@rx.var interval=60s)
    participant Client as Browser

    App->>Mon: register_lifespan_task()
    loop Every 60 seconds
        Mon->>Checkly: GET /v1/check-groups/{id}/checks
        Checkly-->>Mon: [check IDs]
        par For each check_id
            Mon->>Checkly: GET /v1/check-statuses/{check_id}
            Checkly-->>Mon: {hasFailures, isDegraded}
        end
        Mon->>Mon: Update CURRENT_STATUS global
    end
    loop Every 60 seconds (client poll)
        Client->>State: poll StatusState.status
        State-->>Client: CURRENT_STATUS value
        Client->>Client: Re-render server_status badge
    end
Loading

Reviews (1): Last reviewed commit: "ENG-9279: Add status to reflex.dev foote..." | Re-trigger Greptile

Comment thread packages/reflex-ui-shared/src/reflex_ui_shared/backend/status.py
Comment thread packages/reflex-ui-shared/src/reflex_ui_shared/components/server_status.py Outdated
Comment thread packages/reflex-ui-shared/src/reflex_ui_shared/backend/status.py Outdated
Comment thread packages/reflex-ui-shared/src/reflex_ui_shared/backend/status.py
@carlosabadia carlosabadia marked this pull request as draft April 21, 2026 16:34
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