Repository navigation
fix(analytics): retire the research view and profile update event types - #4993
Merged
quntao-z merged 1 commit intoOct 11, 2026
Merged
Conversation
…t types Neither type has an emitter, and on 2026-10-11 their stored rows were deleted from Development and Production, so remove both enum members, the per-user profileUpdates column, and their reads in search attribution and the research event-type table. Record the decision that an event type losing its last emitter loses its rows and its enum member together, superseding the 2026-08-29 keep-for-history rule. Closes #4992
ycs-ylabs-maintenance
temporarily deployed
to
fix/analytics-retire-legacy-view-and-profile-update - yalelabs-beta PR #4993
October 11, 2026 20:57 — with
Render
Destroyed
There was a problem hiding this comment.
Approved automatically: the author holds the Admin repository role (#4512).
quntao-z
deleted the
fix/analytics-retire-legacy-view-and-profile-update
branch
October 11, 2026 21:05
This branch was successfully deployed
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.
Intent
Retire the two analytics event types that nothing emits any more, now that their stored history was deleted from Development and Production on 2026-10-11 by the owner's decision, so every stored event type has a live emitter and no dead type can feed a dashboard total. Record the decision in docs/decisions.md as superseding the 2026-08-29 keep-for-history rule. PR body rule: describe the regression tests by behaviour only and never quote a test fixture string, slug, or name from the diff, because the guard scans the body and a quoted fixture reads as a real person. Do not quote dashboard tile names in capitals. Link the issue with Closes #4992 and state that the data operation already ran on Development and Production.
What Changed
research_viewandprofile_updatemembers fromAnalyticsEventType. Nothing emits either type any more. Their reads are gone fromanalyticsService: the research engagement totals, the search-quality attribution window, and the per-userprofileUpdatescount, which is also dropped fromAnalyticsUserSummaryand the clientAnalyticsUserActivityRow.docs/decisions.mdthat supersedes the 2026-08-29 keep-for-history rule, and marks the older entry as superseded. It also updates the analytics docs andDEVELOPER_GUIDE.mdso they match.The data operation already ran on Development and Production: every stored row of the two types was deleted, with a local backup. Beta held none. Every stored event type now has a live emitter.
Closes #4992
Risk Assessment
✅ Low: The change only removes two enum members and the dashboard reads, column and attribution entries that depended on them, and no code anywhere in the repo still references either type; the batch route already rejects unknown types, and the decisions entry correctly supersedes the 2026-08-29 rule.
Testing
I ran the real API on a throwaway local MongoDB seeded with synthetic legacy rows, then ran the base commit against the same data. Base counted the 3 legacy research-view rows in the research totals, gave one user 5 events, and listed a user who had only retired rows. Target showed only the live research_profile_open type, gave that user 2 events, and dropped the retired-only user. It also returned no profileUpdates field anywhere. The research batch endpoint treats both retired types as unrecognized. The focused analytics tests pass. No screenshot was taken: the client side only removes a field from a TypeScript type and changes no rendered surface. The emitter check and the decisions-doc check were done by reading source, not live, so they are marked untested. All temporary DB, server and script files were torn down.
Evidence: Target /api/analytics overview (retired types absent)
Evidence: Target /api/analytics/users (no profileUpdates, retired-only user absent)
Evidence: Baseline /api/analytics overview (research_view total 3)
Evidence: Baseline /api/analytics/users (inflated totals, profileUpdates column)
Evidence: Research batch ingest of retired types
research_view -> accepted 0 (rejected as unrecognized); profile_update -> accepted 0 (unrecognized); research_save control -> recognized, rejected only because the synthetic entity does not existPipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
Booted the real server at the target commit (npx tsx src/index.ts, NODE_ENV=development, LOCAL_AUTH_BYPASS as admin) against a throwaway mongod on 127.0.0.1:27991 with its own /tmp dbpathInserted synthetic analytics_events: 3 research_view, 2 profile_update, and research_profile_open/search/login rows. One synthetic user had only retired rows.curl GET /api/analyticsandGET /api/analytics/usersas admin, on the target server (port 4992)The same two calls on the base commit 5790e4d7c, booted from agit archivecopy on port 4993 against the same seeded DBcurl POST /api/analytics/research/batchwith research_view, profile_update, and research_save as a control, then read the server's rejection loggrepof server/src and client/src for any remaining emitter of the retired types, and a check that LOGOUT still has an emitter (passport.ts)npx vitest run src/services/__tests__/analyticsService.test.ts src/services/__tests__/searchQualityAttribution.equivalence.test.tsRead the docs/decisions.md diff: a new 2026-10-11 entry, plus a note on the 2026-08-29 entry marking it superseded✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.