Skip to content

fix: resolve daily personalise state via snotra user API#3993

Merged
capJavert merged 1 commit into
mainfrom
fix/daily-snotra-user-api-origin
Jul 8, 2026
Merged

fix: resolve daily personalise state via snotra user API#3993
capJavert merged 1 commit into
mainfrom
fix/daily-snotra-user-api-origin

Conversation

@capJavert

Copy link
Copy Markdown
Contributor

Problem

FeedDailyConfigGenerator resolves the user's personalise state to pick between daily_v1 (personalised) and daily_cs_v1 (cold start). It was constructed with the shared snotraClient, which points at SNOTRA_ORIGIN (the snotra memory API). That origin serves /api/v1/memstore/shortprofile but not /api/v1/user/profile, so every getUserProfile call fails with a 404.

Because resolvePersonaliseState swallows the error and returns undefined, the generator always falls back to the personalised config:

  • daily_cs_v1 is never selected in production (zero requests in fss_events over the last 20 days).
  • Cold-start users (no sauron embeddings yet) get an empty daily feed from daily_v1 — observed via the failed to resolve snotra personalise state for daily feed error logged on every dailyHeadlines request, and a chunk of daily-posts responses returning 0 posts for recently onboarded users.

Fix

Add snotraUserApiClient pointing at SNOTRA_USER_API_ORIGIN (the same origin the personalized digest flow already uses for getUserProfile) and wire it into dailyFeedConfigGenerator. Existing snotraClient consumers (getProfile / memstore endpoints) are untouched.

Verified daily_cs_v1 itself returns posts when exercised directly against the feed service with production-shaped payloads, so fixing state resolution is enough to restore the cold-start path.

Tests

Updated the getUserProfile spies in __tests__/feeds.ts to target the new client.

FeedDailyConfigGenerator was wired with the snotra memory API client,
whose origin does not serve /api/v1/user/profile and returns 404 on
every call. The personalise state therefore always resolved to
undefined, the generator always fell back to daily_v1, and cold-start
users (no sauron embeddings) got an empty daily feed while daily_cs_v1
was never selected.

Use a client pointed at SNOTRA_USER_API_ORIGIN, matching what the
personalized digest flow already does for the same endpoint.
@pulumi

pulumi Bot commented Jul 8, 2026

Copy link
Copy Markdown

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

Resource Changes

    Name                                                       Type                           Operation
~   vpc-native-clean-expired-better-auth-sessions-cron         kubernetes:batch/v1:CronJob    update
~   vpc-native-user-profile-updated-sync-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-post-analytics-history-day-clickhouse-cron      kubernetes:batch/v1:CronJob    update
~   vpc-native-post-analytics-achievements-cron                kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-channel-highlights-cron                   kubernetes:batch/v1:CronJob    update
~   vpc-native-generate-search-invites-cron                    kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-users-cron                         kubernetes:batch/v1:CronJob    update
~   vpc-native-update-highlighted-views-cron                   kubernetes:batch/v1:CronJob    update
~   vpc-native-personalized-digest-deployment                  kubernetes:apps/v1:Deployment  update
~   vpc-native-hourly-notification-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-subscription-anniversary-achievements-cron      kubernetes:batch/v1:CronJob    update
~   vpc-native-rotate-daily-quests-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-update-tags-str-cron                            kubernetes:batch/v1:CronJob    update
~   vpc-native-daily-digest-cron                               kubernetes:batch/v1:CronJob    update
~   vpc-native-generic-referral-reminder-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-sync-subscription-with-cio-cron                 kubernetes:batch/v1:CronJob    update
~   vpc-native-channel-digests-cron                            kubernetes:batch/v1:CronJob    update
~   vpc-native-user-profile-analytics-history-clickhouse-cron  kubernetes:batch/v1:CronJob    update
~   vpc-native-expire-super-agent-trial-cron                   kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-images-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-gifted-plus-cron                          kubernetes:batch/v1:CronJob    update
~   vpc-native-bg-deployment                                   kubernetes:apps/v1:Deployment  update
~   vpc-native-calculate-top-readers-cron                      kubernetes:batch/v1:CronJob    update
+   vpc-native-api-db-migration-804f9d7d                       kubernetes:batch/v1:Job        create
~   vpc-native-user-posts-analytics-refresh-cron               kubernetes:batch/v1:CronJob    update
-   vpc-native-api-clickhouse-migration-aafdbcd5               kubernetes:batch/v1:Job        delete
~   vpc-native-update-achievement-rarity-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-channel-highlights-cron                         kubernetes:batch/v1:CronJob    update
~   vpc-native-update-tag-materialized-views-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-update-current-streak-cron                      kubernetes:batch/v1:CronJob    update
+   vpc-native-api-clickhouse-migration-804f9d7d               kubernetes:batch/v1:Job        create
~   vpc-native-clean-old-notifications-cron                    kubernetes:batch/v1:CronJob    update
~   vpc-native-squad-posts-analytics-refresh-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-stale-user-transactions-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-validate-active-users-cron                      kubernetes:batch/v1:CronJob    update
~   vpc-native-check-analytics-report-cron                     kubernetes:batch/v1:CronJob    update
~   vpc-native-update-views-cron                               kubernetes:batch/v1:CronJob    update
-   vpc-native-api-db-migration-aafdbcd5                       kubernetes:batch/v1:Job        delete
~   vpc-native-post-analytics-clickhouse-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-user-profile-analytics-clickhouse-cron          kubernetes:batch/v1:CronJob    update
~   vpc-native-materialize-monthly-best-post-archives-cron     kubernetes:batch/v1:CronJob    update
... and 15 other changes

@capJavert capJavert merged commit 98eb693 into main Jul 8, 2026
7 of 8 checks passed
@capJavert capJavert deleted the fix/daily-snotra-user-api-origin branch July 8, 2026 10:54
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