JM: Reach the person history through records that hang off a person - #2354
Open
maebeale wants to merge 1 commit into
Open
JM: Reach the person history through records that hang off a person#2354maebeale wants to merge 1 commit into
maebeale wants to merge 1 commit into
Conversation
6 tasks
Collaborator
Author
|
🤖 From Claude: Scope decided — keeping all ten resource types rather than trimming to the money/forms subset. Completeness over scannability; filtering belongs in the UI. The read-time traversal question against #2251 is still open. |
PersonActivityEvents maps person -> ids per Ahoy resource_type, and records that connect to a person only through a parent were absent from that map. Their events are recorded — AhoyTrackable covers every model — they just had no route to a person: the registration's children, the money ledger, form answers and their uploads, and scholarship agreement responses. Ten types added. Nothing needs backfilling; the mapping is read-time, so it covers everything already recorded. Part of #2251. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
maebeale
force-pushed
the
maebeale/person-history-reach
branch
from
August 23, 2026 21:29
7784396 to
1a2ce63
Compare
maebeale
marked this pull request as ready for review
August 24, 2026 12:26
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.
🤖 suggested review level: 3 Read 📖 contained: ten resource types added to one query service, no schema change
Part of #2251.
Reach, not tracking
AhoyTrackablealready covers every model, so a person's history isn't missing events — it's missing routes to them.Analytics::PersonActivityEventsmapsperson → idsperresource_type, and records that connect to a person only through a parent were absent from that map.Nothing needs backfilling: the mapping is read-time, so it covers everything already recorded.
Ten types added
EventRegistrationChecklistCompletion,EventRegistrationOrganization,EventAttendanceTimeEntryEventStaffAllocation(through registration / CE registration / membership invoice),Refund(recipient, or reversing one of their payments),MembershipInvoiceFormAnswer, plus theAssetuploads those answers ownScholarshipAgreementResponseRepeated subqueries (registration / submission / payment / scholarship ids) are memoized rather than rebuilt inline.
How to test
ai/server, sign in as an admin./people/:id/edit→ Associated records → History, or/admin/activities/events?person_id=:id&time_period=all_time&audience[]=visitors&audience[]=users&audience[]=staff.create.allocation,update.event_registration_checklist_completion,create.form_answer,create.asset. Onmainnone of those can reach a person's history no matter how many exist.Scope: all ten, decided
Keeping the full set, including the mechanical ones (
create.allocation,update.event_registration_checklist_completion,update.event_attendance_time_entry). The history is meant to be complete; filtering for readability belongs in the UI, not in what reaches the page.Note on the approach
This reaches the records at read time — the relation is an OR of ~33 subqueries, bounded per person. #2251 sketches a denormalized tag table instead; that's a different mechanism for a wider problem (event and organization timelines), and not a blocker here.