Skip to content

feat: add get_alerts_modified_since and fix admin transfer security#162

Merged
habiba-d-coder merged 2 commits into
Tx-wat:mainfrom
pugsley76:feature/incremental-sync-and-admin-transfer-security
May 31, 2026
Merged

feat: add get_alerts_modified_since and fix admin transfer security#162
habiba-d-coder merged 2 commits into
Tx-wat:mainfrom
pugsley76:feature/incremental-sync-and-admin-transfer-security

Conversation

@pugsley76
Copy link
Copy Markdown

closes #37
closes #61

feat: add get_alerts_modified_since and fix admin transfer security

alert-registry:

  • Add get_alerts_modified_since(since: u64) -> Vec 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

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
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 30, 2026

@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! 🚀

Learn more about application limits

@habiba-d-coder habiba-d-coder merged commit c8f7d26 into Tx-wat:main May 31, 2026
0 of 2 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.

Test: Add test for register_watcher by non-admin after transfer_admin Feature: Add timestamp-based filter for incremental alert sync

2 participants