Skip to content

fix: alert rules keep their app; backup views refresh live - #127

Merged
vazra merged 2 commits into
mainfrom
fix/alert-rule-app-backup-refresh
Oct 11, 2026
Merged

vazra merged 2 commits into
mainfrom
fix/alert-rule-app-backup-refresh

Conversation

@vazra

@vazra vazra commented Oct 11, 2026

Copy link
Copy Markdown
Owner

Found by the E2E audit.

  • The alert rule form dropped the chosen app. The UI sends app_slug; POST/PUT /api/alerts/rules only read app_id. A rule created for one app became an all-apps rule, editing any app rule in the UI made it global, and manage users could not create rules at all. The API now accepts app_slug (resolved and authorized with the same rules as app_id; unknown slugs are 400 for super admins and look like an inaccessible app to others; id/slug mismatch is 400).
  • The app Backups tab never updated after "Backup Now": runs published no realtime event, though the realtime docs said global:backups covered runs. The scheduler now publishes backup.run on app:<slug> and global:backups when a backup or restore run starts and finishes (before webhook alerts go out). The Backups tab subscribes and refetches.
  • Events about one app carry the app (never sent to clients); the socket delivers them only to users who can view that app, even on global topics, so other users do not learn that an app's backups ran.

Docs: alerts rules guide, API reference, architecture/realtime.md.

Tests: alert rule scope (create/update keep the app, manage user limits, unknown slug, mismatch), Alerts form payload vitest; scheduler publishes start/finish (success, failure, early failure, restore), socket filters app-tagged events per user (fails without the filter), Backups tab refetch vitest.

vazra added 2 commits October 11, 2026 02:45
POST/PUT /api/alerts/rules only read app_id while the UI sends app_slug, so app rules became all-apps rules and manage users could not create any. Accept app_slug (resolved and authorized via canMutateForApp), reject unknown slugs and id/slug mismatches.
@vazra
vazra merged commit c86ae4a into main Oct 11, 2026
8 checks passed
@vazra
vazra deleted the fix/alert-rule-app-backup-refresh branch October 11, 2026 17:19
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