feat: create post www dedup#3946
Conversation
|
🍹 The Update (preview) for dailydotdev/api/prod (at 04ea9c6) was successful. ✨ Neo Code ReviewRoutine deployment of the www/non-www URL deduplication feature with accompanying DB and ClickHouse migrations; no stateful resources are being replaced and no data loss risk exists. ✅ Low RiskThis is a standard application deployment rolling out commit Both DB and ClickHouse migration jobs are being cycled (old commit-tagged jobs deleted, new ones created), which is the normal per-deploy migration pattern. The migration jobs will run before or alongside the rolling deployment of all seven deployments and their associated cron jobs. 🔵 Info — The dedup logic ( Resource Changes Name Type Operation
~ vpc-native-update-highlighted-views-cron kubernetes:batch/v1:CronJob update
~ vpc-native-squad-posts-analytics-refresh-cron kubernetes:batch/v1:CronJob update
~ vpc-native-rotate-daily-quests-cron kubernetes:batch/v1:CronJob update
~ vpc-native-private-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-rotate-weekly-quests-cron kubernetes:batch/v1:CronJob update
~ vpc-native-user-profile-analytics-history-clickhouse-cron kubernetes:batch/v1:CronJob update
~ vpc-native-worker-job-deployment kubernetes:apps/v1:Deployment update
- vpc-native-api-clickhouse-migration-b02d2849 kubernetes:batch/v1:Job delete
~ vpc-native-user-profile-analytics-clickhouse-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-achievement-rarity-cron kubernetes:batch/v1:CronJob update
~ vpc-native-generate-search-invites-cron kubernetes:batch/v1:CronJob update
~ vpc-native-user-posts-analytics-refresh-cron kubernetes:batch/v1:CronJob update
~ vpc-native-ws-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-clean-stale-user-transactions-cron kubernetes:batch/v1:CronJob update
+ vpc-native-api-clickhouse-migration-0eec750d kubernetes:batch/v1:Job create
~ vpc-native-clean-expired-better-auth-sessions-cron kubernetes:batch/v1:CronJob update
~ vpc-native-post-analytics-achievements-cron kubernetes:batch/v1:CronJob update
~ vpc-native-sync-subscription-with-cio-cron kubernetes:batch/v1:CronJob update
~ vpc-native-user-profile-updated-sync-cron kubernetes:batch/v1:CronJob update
~ vpc-native-calculate-top-readers-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-zombie-users-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-tag-materialized-views-cron kubernetes:batch/v1:CronJob update
~ vpc-native-materialize-yearly-best-post-archives-cron kubernetes:batch/v1:CronJob update
- vpc-native-api-db-migration-b02d2849 kubernetes:batch/v1:Job delete
~ vpc-native-update-trending-cron kubernetes:batch/v1:CronJob update
+ vpc-native-api-db-migration-0eec750d kubernetes:batch/v1:Job create
~ vpc-native-personalized-digest-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-current-streak-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-source-public-threshold-cron kubernetes:batch/v1:CronJob update
~ vpc-native-expire-super-agent-trial-cron kubernetes:batch/v1:CronJob update
~ vpc-native-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-personalized-digest-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-clean-old-notifications-cron kubernetes:batch/v1:CronJob update
~ vpc-native-temporal-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-clean-gifted-plus-cron kubernetes:batch/v1:CronJob update
~ vpc-native-hourly-notification-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-tags-str-cron kubernetes:batch/v1:CronJob update
~ vpc-native-check-analytics-report-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-zombie-user-companies-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-zombie-images-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-channel-highlights-cron kubernetes:batch/v1:CronJob update
... and 14 other changes |
|
@claude review |
|
Claude finished @capJavert's task in 59s —— View job Code Review: www / non-www dedupI reviewed the diff ( 🟡 Race condition (TOCTOU) — 🟡 Two lookups where one would do — the create path now does the variant const existing = await con.getRepository(ArticlePost).findOneBy({
url: In([req.url, variantUrl]),
});Not required, but it makes the dedup intent explicit and saves a round-trip. Minor. 🟢 Regex correctness — 🟢 Ordering — running this after 🔵 Nit — JSDoc noise — the auto-generated block comment (lines 50–63) largely restates the TS signature ( Overall: clean, well-tested change. The main thing to weigh is whether the lack of a DB-level guarantee for the variant matters for your ingestion concurrency, or if best-effort dedup is sufficient here. |
|
@claude both are fine we want to keep minimal changes, i evaluated index based check but it would require cleanup of existing www duplicates which is more work and out of scope for now |
|
Claude finished @capJavert's task in 18s —— View job Re: www / non-www dedupMakes sense — best-effort dedup at the application layer is a reasonable scope boundary here. Both points I raised were "consider," not "must fix":
No blockers from my side. The change is clean and well-tested. 👍 |
No description provided.