feat: add get_alerts_modified_since and fix admin transfer security#162
Merged
habiba-d-coder merged 2 commits intoMay 31, 2026
Conversation
alert-registry: - Add get_alerts_modified_since(since: u64) -> Vec<AlertConfig> for efficient incremental sync by watcher nodes; returns all live alerts with updated_at >= since, scanning the full ID range 0..NEXT_ID - Fix update_webhook and remove_alert which referenced undefined 'owner' variable (parameter was named 'caller'); both now use caller correctly - Remove duplicate assert_owner private fn that would cause compile error - Add 6 tests: empty registry, since=0 returns all, timestamp filtering, updated alert appears in next sync, removed alerts excluded, boundary inclusivity (updated_at == since is included, since+1 excludes it) watcher-registry: - Fix transfer_admin bug: was writing new admin to 'ADMINS' storage key but load_admins/assert_admin read from 'ADMIN'; after transfer neither old nor new admin could act -- now correctly overwrites 'ADMIN' key - Add test_transfer_admin_original_admin_cannot_register_watchers: verifies original admin gets Unauthorized on register_watcher and remove_watcher after transfer, and new admin retains full privileges
|
@pugsley76 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! 🚀 |
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.
closes #37
closes #61
feat: add get_alerts_modified_since and fix admin transfer security
alert-registry:
efficient incremental sync by watcher nodes; returns all live alerts
with updated_at >= since, scanning the full ID range 0..NEXT_ID
variable (parameter was named 'caller'); both now use caller correctly
updated alert appears in next sync, removed alerts excluded, boundary
inclusivity (updated_at == since is included, since+1 excludes it)
watcher-registry:
but load_admins/assert_admin read from 'ADMIN'; after transfer neither
old nor new admin could act -- now correctly overwrites 'ADMIN' key
original admin gets Unauthorized on register_watcher and remove_watcher
after transfer, and new admin retains full privileges