[PM-37944] Differentiate Send events according to domain#7690
[PM-37944] Differentiate Send events according to domain#7690harr1424 wants to merge 34 commits into
Conversation
…access-event-logging-domains merge [PM-36563] Send access event logs
…access-event-logging-domains merge latest from standard access event logging branch
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #7690 +/- ##
==========================================
+ Coverage 61.34% 65.87% +4.52%
==========================================
Files 2244 2247 +3
Lines 98682 98968 +286
Branches 8915 8939 +24
==========================================
+ Hits 60537 65193 +4656
+ Misses 36008 31540 -4468
- Partials 2137 2235 +98 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@claude please review |
|
Claude finished @harr1424's task in 5m 10s —— View job Claude Code Review
Overall this is a solid, well-tested feature. Per-org attribution is cleanly modeled, the new event row carries a Findings1. N+1 DB roundtrips per org access (perf) —
Send access is anonymous / unauthenticated abuse-prone — keeping the work per access bounded is worth doing now rather than as a follow-up. 2. Missing index on
CREATE NONCLUSTERED INDEX [IX_Event_OrganizationIdSendIdDate]
ON [dbo].[Event] ([OrganizationId], [SendId], [Date] DESC)
WHERE [SendId] IS NOT NULLAdd it in both 3. Redundant work in anonymous Access path —
4. Redundant case normalization —
5. Provider rows for access events still credit the owner — For Send access events, the provider row sets
If the product decision is "providers don't see Send-access detail," option 1 is cleaner. 6. Pre-existing reviewer comment looks resolved — The earlier Smaller notes
TestsTest coverage is the strongest part of this PR. |
| ON [dbo].[Event]([Date] DESC, [OrganizationId] ASC, [ActingUserId] ASC, [CipherId] ASC) INCLUDE ([ServiceAccountId], [GrantedServiceAccountId]); | ||
|
|
||
| GO | ||
| CREATE NONCLUSTERED INDEX [IX_Event_OrganizationIdSendIdDate] |
There was a problem hiding this comment.
👍I just wanted to leave a note on this. We have some self-host customers with very large Event tables. I did a test locally to simulate this and found that this index took about a minute to build. This is because the SendId is added as NULL, and this index is filtered where SendId is NOT NULL, so the CREATE INDEX essentially just needs to scan the Event table and create an empty index.
Banrion
left a comment
There was a problem hiding this comment.
✅ DIRT Files look good
3c54239
|



🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-37944
📔 Objective
This PR introduces capability to differentiate when an email-verified Send is created and/or accessed based upon if the accessor email matches a domain claimed by a given organization.
companion clients PR