fix(db): preserve legacy digest subscriptions#1693
Conversation
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-06-29 16:19:45 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 6 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1693 +/- ##
=======================================
Coverage 95.58% 95.58%
=======================================
Files 204 204
Lines 22295 22295
Branches 8053 8053
=======================================
Hits 21310 21310
Misses 408 408
Partials 577 577
🚀 New features to boost your workflow:
|
Motivation
login/emailto lowercase but did not make legacy mixed-case rows discoverable, which caused duplicate rows and lookup/visibility regressions for existing subscriptions.Description
migrations/0083_normalize_digest_subscription_logins.sqlthat canonicalizes existingdigest_subscriptionsby collapsing case-variant duplicates usinglower(login), lower(email)and keeping the newest row per logical subscription.listDigestSubscriptionsForLoginto comparelower(login)against the lowercased lookup key so legacy mixed-case rows remain visible prior to/after migration.test/unit/product-usage.test.tsthat exercise migration normalization and that a legacy mixed-case row is visible via the lookup API.Testing
npx vitest run test/unit/product-usage.test.ts -t "digest subscription", which executed the new tests and passed.npm run db:migrations:check, which reported the migration set is contiguous and OK.npm run typecheck, which passed with no TypeScript errors.npm run test:coverage -- test/unit/product-usage.test.ts: the tests executed but coverage remapping failed withTypeError: jsTokens is not a functionduring V8 coverage processing.npm run test:ci: it stopped early inactionlintdue to network resolution failure (fallback flagged a custom self-hosted runner label), andnpm audit --audit-level=moderatefailed to reach the audit endpoint (HTTP 403), so those CI-level steps did not complete in this environment.Codex Task