Skip to content

fix: remap unknown-source posts in channel digest to public shares#3915

Merged
idoshamun merged 1 commit into
mainfrom
fix/channel-digest-unknown-source-remap
May 28, 2026
Merged

fix: remap unknown-source posts in channel digest to public shares#3915
idoshamun merged 1 commit into
mainfrom
fix/channel-digest-unknown-source-remap

Conversation

@idoshamun
Copy link
Copy Markdown
Member

Summary

  • Articles created via squad shares of external links have sourceId='unknown' and don't render as standalone pages. After feat: render topical digest links #3914 added [Read more] links to topical digests, any unknown-source article that Bragi picked surfaced as a broken /posts/<id> link.
  • Mirrors the channelHighlight pattern: for each unknown-source candidate, swap to the best public SharePost counterpart via the existing fetchPublicShareFallbackPostIds helper. Falls back to the original id when no public share exists, so editorial coverage isn't lost on rare orphans.
  • Tightened fetchPublicShareFallbackPostIds to select only id + sharedPostId.

Verified

  • 6 generator tests pass (4 existing + 2 new: remap-when-share-exists, keep-when-no-share)
  • All 8 worker tests + 31 channel-highlight tests still pass
  • Dry-ran against the agentic digest on prod data (no post written): 6/27 candidates were unknown-sourced, all 6 successfully remapped to their public shares. Before the fix, one of those would have linked to /posts/tl2aTyPEZ (broken); after, it links to /posts/eC0jdjIYx (the public share).

Test plan

  • Wait for next agentic digest cron run and confirm no unknown-source links in the generated post

Articles created via squad shares have sourceId='unknown' and aren't
surfaced anywhere, so digest links to them landed on broken pages.

Mirroring the channel-highlight pattern, swap unknown post ids for
their best public SharePost counterpart via the existing
fetchPublicShareFallbackPostIds helper. Keep the original id when no
public share exists. Also tightened the helper to select only the
columns it returns.
@pulumi
Copy link
Copy Markdown

pulumi Bot commented May 28, 2026

🍹 The Update (preview) for dailydotdev/api/prod (at c23a7fd) was successful.

✨ Neo Explanation

Standard image rollout deploying a channel digest improvement that remaps `UNKNOWN_SOURCE` posts to their public SharePost equivalents. All changes are application-level with no infrastructure modifications; this is ✅ Low Risk.

This is a routine application deployment rolling out commit 37feb0e7 (previously 0c8c6467) across all workloads. The code change introduces unknown-source post remapping in the channel digest pipeline: when generateChannelDigest finds posts belonging to UNKNOWN_SOURCE, it now looks up public SharePost counterparts and substitutes their IDs before sending to the AI digest service, ensuring digest links point to publicly accessible posts rather than internal/unknown-source ones.

The migration jobs (both DB and Clickhouse) are being cycled to the new commit hash as expected — the old jobs are deleted and new ones created. No schema-breaking changes are apparent from the diff; the only DB query change is adding sourceId to the SELECT in findDigestPosts and adding an explicit .select() call in fetchPublicShareFallbackPostIds (which fixes a previously unguarded column selection).

Resource Changes

    Name                                                       Type                           Operation
~   vpc-native-channel-highlights-cron                         kubernetes:batch/v1:CronJob    update
~   vpc-native-update-highlighted-views-cron                   kubernetes:batch/v1:CronJob    update
~   vpc-native-ws-deployment                                   kubernetes:apps/v1:Deployment  update
~   vpc-native-user-profile-updated-sync-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-rotate-daily-quests-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-bg-deployment                                   kubernetes:apps/v1:Deployment  update
~   vpc-native-validate-active-users-cron                      kubernetes:batch/v1:CronJob    update
~   vpc-native-update-trending-cron                            kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-gifted-plus-cron                          kubernetes:batch/v1:CronJob    update
~   vpc-native-calculate-top-readers-cron                      kubernetes:batch/v1:CronJob    update
~   vpc-native-worker-job-deployment                           kubernetes:apps/v1:Deployment  update
~   vpc-native-personalized-digest-deployment                  kubernetes:apps/v1:Deployment  update
+   vpc-native-api-clickhouse-migration-37feb0e7               kubernetes:batch/v1:Job        create
~   vpc-native-generate-search-invites-cron                    kubernetes:batch/v1:CronJob    update
~   vpc-native-post-analytics-clickhouse-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-user-profile-analytics-history-clickhouse-cron  kubernetes:batch/v1:CronJob    update
~   vpc-native-hourly-notification-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-update-source-public-threshold-cron             kubernetes:batch/v1:CronJob    update
~   vpc-native-materialize-monthly-best-post-archives-cron     kubernetes:batch/v1:CronJob    update
~   vpc-native-update-views-cron                               kubernetes:batch/v1:CronJob    update
~   vpc-native-squad-posts-analytics-refresh-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-deployment                                      kubernetes:apps/v1:Deployment  update
~   vpc-native-user-profile-analytics-clickhouse-cron          kubernetes:batch/v1:CronJob    update
~   vpc-native-private-deployment                              kubernetes:apps/v1:Deployment  update
-   vpc-native-api-clickhouse-migration-0c8c6467               kubernetes:batch/v1:Job        delete
~   vpc-native-personalized-digest-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-rotate-weekly-quests-cron                       kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-expired-better-auth-sessions-cron         kubernetes:batch/v1:CronJob    update
~   vpc-native-daily-digest-cron                               kubernetes:batch/v1:CronJob    update
~   vpc-native-temporal-deployment                             kubernetes:apps/v1:Deployment  update
~   vpc-native-clean-old-notifications-cron                    kubernetes:batch/v1:CronJob    update
~   vpc-native-post-analytics-history-day-clickhouse-cron      kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-opportunities-cron                 kubernetes:batch/v1:CronJob    update
~   vpc-native-update-achievement-rarity-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-expire-super-agent-trial-cron                   kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-user-companies-cron                kubernetes:batch/v1:CronJob    update
~   vpc-native-update-tags-str-cron                            kubernetes:batch/v1:CronJob    update
~   vpc-native-channel-digests-cron                            kubernetes:batch/v1:CronJob    update
~   vpc-native-user-posts-analytics-refresh-cron               kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-stale-user-transactions-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-check-analytics-report-cron                     kubernetes:batch/v1:CronJob    update
... and 12 other changes

@idoshamun idoshamun merged commit d4f6994 into main May 28, 2026
8 checks passed
@idoshamun idoshamun deleted the fix/channel-digest-unknown-source-remap branch May 28, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant