Repository navigation
fix(history): owners see changes to their account, not an administrator's views - #346
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 57 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
A view may be a misclick or a confidential inquiry. The owner's security history shows changes, each with its reason; only the audit keeps views.
PiquelChips
force-pushed
the
fix/hide-account-view-event
branch
from
November 4, 2026 17:12
b651142 to
134a1aa
Compare
PiquelChips
added a commit
that referenced
this pull request
Nov 4, 2026
…sts unless asked for (#350) Every reload of an account's pages recorded another "Account details viewed", so a single investigation buried the account's real changes under a dozen identical rows in the admin dashboard's event lists. The views are worth keeping, since they're the only record of who read whose data, but one per sitting is enough. - **Once an hour:** `Operator::record_view` replaces the three places that recorded views. It skips the write when the same administrator, in the same dashboard session, already viewed the account within the hour; for the CLI, "same" means the same operator user and host. This also removes the `OnceCell` that `Viewer` used to record one view per page. - **Hidden by default:** the dashboard's overview, account page and events page now leave views out. The events page has a "Show views" / "Hide views" link, which applies at once and keeps the account and kind filters (a checkbox did nothing until Filter was pressed, since the dashboard loads no JavaScript). `audit list` gained `--views`, and filtering by the kind `account_viewed` still lists them. Follows #346, which took views out of the owner's own history. Proved after rebasing onto main with the auth-service and repository database tests on a scratch cluster (342/342 pass), an up-to-date SQLx cache and clean clippy. Two new tests cover it: a reload records no second view while another administrator records their own, and the events list includes views only when asked. A new browser test in `admin.spec.ts` shows and hides an account's views from the events page; it passes against a preview of this branch, as do the other dashboard tests the preview can run. Reviewed with review-loop: 2 rounds with 2× gpt-6.1-sol and claude-opus-5-5. Verdict: approved > [!NOTE] > Written by Claude Opus 5.5 in Claude Code (via T3 Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Whenever an administrator opened an account, the owner's security history showed "Account details viewed". A view tells the owner nothing they can act on, and it may be a misclick or an inquiry they shouldn't know about. Owners should see changes, each with its reason, not what an administrator looked at.
Now
DomainEvent::history_entryhidesAccountViewed, so views disappear from the history page, the overview's security-event count and the data export. Views are still recorded in the audit log and still show on the admin dashboard's events and in Grafana.Proved with the auth-service history, view, export and overview database tests on a scratch cluster (13/13 pass) and clean clippy. The pagination test now records a view before an admin change and checks that only the change shows.
Reviewed with review-loop: 1 round with 2× GPT-6.1 Sol and Claude Opus 5.5. Verdict: approved
Note
Written by Claude Opus 5.5 in Claude Code and reviewed by GPT-6.1 Sol and Claude Opus 5.5 (via T3 Code)
🤖 Generated with Claude Code