Repository navigation
fix: alert rules keep their app; backup views refresh live - #127
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found by the E2E audit.
app_slug; POST/PUT/api/alerts/rulesonly readapp_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 acceptsapp_slug(resolved and authorized with the same rules asapp_id; unknown slugs are 400 for super admins and look like an inaccessible app to others; id/slug mismatch is 400).global:backupscovered runs. The scheduler now publishesbackup.runonapp:<slug>andglobal:backupswhen a backup or restore run starts and finishes (before webhook alerts go out). The Backups tab subscribes and refetches.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.