Skip to content

Add opt-in hourly dashboard data updates - #10202

Merged
pelikhan merged 10 commits into
mainfrom
copilot/add-service-worker-dashboard-update
Sep 12, 2026
Merged

Add opt-in hourly dashboard data updates#10202
pelikhan merged 10 commits into
mainfrom
copilot/add-service-worker-dashboard-update

Conversation

Copilot AI commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Adds hourly dashboard data downloads behind an off-by-default browser setting. Updates pause on low battery, data-saver, metered, or cellular connections.

  • Scheduling

    • Triggers hourly downloads through a service worker while the dashboard is open.
    • Caches allow-listed, same-origin dashboard data with network-first fallback.
  • Safety

    • Canaries workers before activation.
    • Force-registers a cache-busted worker when the active worker becomes unhealthy.
    • Bounds install, activation, and download waits to prevent stuck updates.
  • Settings

    • Adds a device-local checkbox to the Settings page.
    • Unregisters the worker and clears scheduling state when disabled.
  • Packaging

    • Includes the worker and update coordinator in dashboard builds and package manifests.

Copilot AI and others added 3 commits September 12, 2026 01:08
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot should be able to download in the background as well

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot resolve the merge conflicts in this pull request

Copilot AI and others added 2 commits September 12, 2026 01:30
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

@copilot should be able to download in the background as well

Implemented in 3b17018. Opted-in dashboards now register hourly Periodic Background Sync where supported, with a PWA manifest, persisted safe data URLs, browser power-aware scheduling, metered-network guards, and foreground fallback.

…orker-dashboard-update

# Conflicts:
#	dashboard/site/src/main.js

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Resolved in merge commit d8f8fc38. The conflict retained both the dashboard data-update coordinator and main’s CLI actions. Full repository validation, 854 dashboard unit tests, and 69 browser tests pass.

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot review implementation and make sure this does not lead to some ghostly service worker because of a bug. Must handle offline gracefully and datatbade full.

Must cap database usage at 2Gb and start dropping older runs if needed.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

@copilot review implementation and make sure this does not lead to some ghostly service worker because of a bug. Must handle offline gracefully and datatbade full.

Must cap database usage at 2Gb and ...

Addressed in e17c258. Disabled settings now clear persisted schedules and discover/unregister stale dashboard workers; cross-tab changes fail closed. The worker serves previously cached app/data responses offline and treats cache-write failures as non-fatal. Canonical IndexedDB is capped at 2 GB with conservative headroom, exact usage checks where available, oldest-first run subtree eviction, bounded transaction history, and progressive quota recovery. Full repository checks, 861 unit tests, 69 browser tests, secret scanning, and CodeQL pass.

@pelikhan
pelikhan marked this pull request as ready for review September 12, 2026 02:25
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot update dashboard aw.yml

@github-actions

github-actions Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Dashboard view assessment

No dashboard views were potentially impacted by this pull request.

The assessment was blocked before every view could be checked.

View Result DOM nodes Findings
View the workflow run.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

@copilot update dashboard aw.yml

Updated dashboard/aw.yml in 6022a7c to document the packaged optional background data updates. Verified the manifest includes all worker, update coordinator, quota, and retention runtime assets; focused package checks pass.

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot data updates must happen even if the page is not opened.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

@copilot data updates must happen even if the page is not opened.

Implemented in 2b0262e. The setting now remains on only after Periodic Background Sync permission is granted and the registered tag is verified, so downloads continue through the service worker after the page closes. Unsupported, denied, or failed registrations turn the setting off and unregister cleanly instead of silently falling back to open-page-only updates.

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot resolve the merge conflicts on this branch.

…orker-dashboard-update

# Conflicts:
#	dashboard/site/src/main.js

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts on this branch.

Resolved in merge commit f8163986. The main.js conflict retains both automatic background data updates and main’s expanded declared CLI actions. npm run check, 873 dashboard unit tests, lint, typecheck, package validation, secret scanning, and CodeQL all pass.

@pelikhan
pelikhan merged commit fe429f5 into main Sep 12, 2026
17 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.

2 participants