fix(account-erasure): track ClickHouse part lineage - #2366
Conversation
Require worker stream prerequisites, refresh erasure fences after migrations, fail loudly when provider revocation cannot be verified, and keep R2 as the sole immutable completion ledger.\n\nRefs #1994
Avoid treating unrelated inactive parts as erased account data when proving MergeTree cleanup through mutation and merge history. Fixes #1994
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Too many files changed for review. ( Bypass the limit by tagging |
|
Important Review skippedToo many files! This PR contains 468 files, which is 368 over the limit of 100. To get a review, narrow the scope: Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (468)
You can disable this status message by setting the 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. Comment |
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
PR Summary by Qodofix(account-erasure): track ClickHouse part lineage for physical-erasure proof
AI Description
Diagram
High-Level Assessment
Files changed (15)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
300 rules✅ Skills:
fix-provider, write-tests, cloudflare 1.
|
There was a problem hiding this comment.
All reported issues were addressed across 462 files
Note: This PR contains a large number of files. cubic only reviews up to 200 files per PR, so some files may not have been reviewed. cubic prioritizes the most important files to review.
Re-trigger cubic
|
Addressed and replied to all 45 actionable review threads in commit b7dbdeb. The fixes cover account-erasure fencing and cleanup races, OAuth rollback/response ordering, Stripe retry safety, mobile/watch/HealthKit state purges, typed SQL backfills, ClickHouse mutation lineage, Swarm secret handling, and one-time deployment backfills. Validation: Biome 2,631 files; TypeScript checks for root/server/mobile/web; 348 focused unit tests; 13 database integration tests; Swift package tests 81/119/14. |
|
Re-audit result: this PR is not merge-ready. It is 209 commits behind main, has 67 merge conflicts, and has 45 unresolved review threads (15 P1). The remaining correctness blockers include the placeholder ClickHouse mutation proof at I have not made a speculative patch on top of this stale/conflicted branch. The implementation needs to be ported onto current main and repaired with executable coverage before this PR can close #1994. |
Pull Request Review SummaryThe PR introduces mobile UI components, capability storage, and status recovery for account erasure, alongside database write fence triggers and background sync gating. The frontend state management, error handling, and recovery flows are robust and thoroughly covered with unit/integration tests. Performance Recommendation
🤖 Reviewed by codereviewbot.ai - Catch bugs before your team does. |
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
# Conflicts: # docs/production-incident-baseline.md # docs/schema.dbml # docs/zoho-desk.md # drizzle/meta/_journal.json # package.json # packages/mobile/app/_layout.cleanup.test.tsx # packages/mobile/app/_layout.tsx # packages/mobile/app/settings.tsx # packages/mobile/components/DataExportSection.test.tsx # packages/mobile/components/DataExportSection.tsx # packages/mobile/lib/auth-context.tsx # packages/mobile/lib/health-kit-sync.ts # packages/mobile/lib/mobile-query-persistence.test.tsx # packages/mobile/lib/mobile-query-persistence.ts # packages/mobile/modules/health-kit/ios/HealthKitModule.swift # packages/mobile/package.json # packages/mobile/test-setup.ts # packages/server/src/companion/token-repository.ts # packages/server/src/index.ts # packages/server/src/repositories/settings-repository.test.ts # packages/server/src/repositories/settings-repository.ts # packages/server/src/router.ts # packages/server/src/routers/companion-pairing.test.ts # packages/server/src/routers/companion-pairing.ts # packages/server/src/routers/companion-token.ts # packages/server/src/routers/file-upload.ts # packages/server/src/routers/recovery-settings-sleep-need-sport-settings.test.ts # packages/server/src/routers/settings.integration.test.ts # packages/server/src/routers/settings.ts # packages/server/src/routers/support.integration.test.ts # packages/server/src/routers/support.test.ts # packages/server/src/routers/support.ts # packages/server/src/routers/sync.ts # packages/server/src/routes/auth/apple-native.ts # packages/server/src/routes/auth/complete-signup.ts # packages/server/src/routes/auth/data-provider-callback.test.ts # packages/server/src/routes/auth/data-provider-callback.ts # packages/server/src/routes/auth/identity-callback.ts # packages/server/src/routes/auth/password-auth.ts # packages/server/src/routes/companion-token.test.ts # packages/server/src/routes/companion-token.ts # packages/server/src/routes/export.ts # packages/server/src/routes/webhooks.ts # packages/server/src/slack/bot-unit.test.ts # packages/server/src/slack/slack-handlers.ts # packages/server/src/trpc.ts # packages/web/src/lib/auth-context.test.tsx # packages/web/src/lib/auth-context.tsx # packages/web/src/lib/posthog.test.ts # packages/web/src/pages/LandingPage.test.tsx # packages/web/src/pages/SettingsPage.tsx # packages/web/src/routeTree.gen.ts # packages/web/src/routes/__root.tsx # packages/web/src/routes/privacy.test.tsx # packages/web/src/routes/privacy.tsx # packages/web/test-setup.ts # pnpm-lock.yaml # src/db/clickhouse-migrations/registry.test.ts # src/db/clickhouse-migrations/registry.ts # src/jobs/data-export-outbox.ts # src/jobs/file-upload-outbox.ts # src/jobs/process-garmin-dump-import-job.ts # src/jobs/process-import-job.ts # src/jobs/process-post-sync-job.ts # src/jobs/process-sync-job.ts # src/jobs/provider-data-deletion-outbox.ts # src/jobs/worker.ts # src/lib/sentry.test.ts # src/zoho-desk.test.ts # vitest.config.ts
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
Mobile PreviewScan to open on device:
To test on device:
|
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
Code Review Summaryoverall look at the account erasure implementation across database migrations, mobile status/erasure screens, storage capabilities, and test suites. Key Observation / Action Required:
Other changes in mobile layout gating, capability persistence, cache cleanup, and Cypress E2E test setup are clean and correctly handled. 🤖 Reviewed by codereviewbot.ai - Catch bugs before your team does. |
|
LGTM! The changes for durable account erasure, database write fences, capability storage, and mobile cleanup/status recovery flows are well structured and thoroughly tested. 🤖 Reviewed by codereviewbot.ai - Catch bugs before your team does. |
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
Summary
Validation
Fixes #1994
Summary by cubic
Implements durable account erasure end to end with instant session revocation, write fences, a public bearer‑status page, and an immutable R2 ledger, and tightens the ClickHouse proof to predicate‑matching parts and lineage. Adds a device erasure cutoff on mobile with full on‑device purge and guards deleted Slack rows; closes #1994.
New Features
apple_private_key; e2e MinIO ledger; Cypress accept/revoke/status flow; workflow_dispatch diff sharding; CI coverage for ClickHouse proof and malformed restore‑ledger metadata.Migration
drizzle/0062_account_erasure.sql.dofek-account-erasure-ledgerwith an indefinite lock.deploy/stack.ymlreads per‑service env files (e.g.,WEB_ENV_FILE) and an externalapple_private_keyDocker secret; CI validates the control‑plane export and renders service‑scoped env files.Written for commit 83a99d3. Summary will update on new commits.