feat: persist community sentiment on social twitter posts#4024
Merged
Conversation
The socialTwitter postUpdated processor now maps extra.community_sentiment/extra.discussions exactly like the article and collection processors, and communitySentiment joins twitterAllowedFields (the whitelist would otherwise silently strip it on every twitter update). No migration (column exists on the Post STI base) and no GraphQL changes (field already exposed). Companion to yggdrasil#711 (X as a community-take discussion provider). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
🍹 The Update (preview) for dailydotdev/api/prod (at 23eef1d) was successful. Resource Changes Name Type Operation
~ vpc-native-update-views-cron kubernetes:batch/v1:CronJob update
~ vpc-native-worker-job-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-validate-active-users-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-post-analytics-achievements-cron kubernetes:batch/v1:CronJob update
~ vpc-native-user-profile-analytics-clickhouse-cron kubernetes:batch/v1:CronJob update
~ vpc-native-channel-highlights-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-old-notifications-cron kubernetes:batch/v1:CronJob update
~ vpc-native-bg-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-clean-zombie-users-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-expired-better-auth-sessions-cron kubernetes:batch/v1:CronJob update
+ api-sub-api.github-account-linked-personal-context gcp:pubsub/subscription:Subscription create
~ vpc-native-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-user-posts-analytics-refresh-cron kubernetes:batch/v1:CronJob update
~ vpc-native-expire-super-agent-trial-cron kubernetes:batch/v1:CronJob update
~ vpc-native-materialize-monthly-best-post-archives-cron kubernetes:batch/v1:CronJob update
~ vpc-native-interest-scheduled-run-cron kubernetes:batch/v1:CronJob update
- vpc-native-api-clickhouse-migration-5ff3281e kubernetes:batch/v1:Job delete
~ vpc-native-clean-zombie-user-companies-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-channel-highlights-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-current-streak-cron kubernetes:batch/v1:CronJob update
+ vpc-native-api-clickhouse-migration-eb4f3204 kubernetes:batch/v1:Job create
~ vpc-native-clean-gifted-plus-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-zombie-images-cron kubernetes:batch/v1:CronJob update
+ vpc-native-api-db-migration-eb4f3204 kubernetes:batch/v1:Job create
~ vpc-native-update-tag-materialized-views-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-stale-user-transactions-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-zombie-opportunities-cron kubernetes:batch/v1:CronJob update
~ vpc-native-personalized-digest-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-update-tags-str-cron kubernetes:batch/v1:CronJob update
~ vpc-native-subscription-anniversary-achievements-cron kubernetes:batch/v1:CronJob update
~ vpc-native-daily-digest-cron kubernetes:batch/v1:CronJob update
~ vpc-native-post-analytics-history-day-clickhouse-cron kubernetes:batch/v1:CronJob update
~ vpc-native-materialize-yearly-best-post-archives-cron kubernetes:batch/v1:CronJob update
~ vpc-native-rotate-daily-quests-cron kubernetes:batch/v1:CronJob update
- vpc-native-api-db-migration-5ff3281e kubernetes:batch/v1:Job delete
~ vpc-native-update-trending-cron kubernetes:batch/v1:CronJob update
~ vpc-native-user-profile-updated-sync-cron kubernetes:batch/v1:CronJob update
~ vpc-native-rotate-weekly-quests-cron kubernetes:batch/v1:CronJob update
... and 18 other changes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Companion to dailydotdev/yggdrasil#711: yggdrasil now generates community takes for tweets (provider "x") and publishes them as ordinary social-twitter post updates carrying
extra.community_sentiment+extra.discussions. This PR makes the socialTwitter processor persist them — the same two-line pattern the article and collection processors already use.Changes
src/workers/postUpdated/socialTwitter/processing.ts:communitySentimentadded totwitterAllowedFields(without it the update whitelist silently strips the column), andtryMapCommunitySentimentPayloadinvoked mirroringarticle/processing.ts— only assigns when a valid take is present, so updates without a take never clobber an existing one, and malformed payloads are ignored (identical semantics to article/collection).extra.community_sentiment/extra.discussionsalready live on the shared postUpdated payload type.PostSTI base), no GraphQL changes (field already exposed).Tests
Four new tests in the existing community-sentiment describe block (
__tests__/workers/postUpdated.ts): set on create, persisted through update (fails without the whitelist change), absent take leaves existing value intact, malformed breakdown ignored.npx jest __tests__/workers/postUpdated.ts→ 105 passed.pnpm run lint0 warnings,pnpm run buildclean.🤖 Generated with Claude Code