Skip to content

feat: persist community sentiment on social twitter posts#4024

Merged
rebelchris merged 3 commits into
mainfrom
feat/community-sentiment-twitter
Jul 24, 2026
Merged

feat: persist community sentiment on social twitter posts#4024
rebelchris merged 3 commits into
mainfrom
feat/community-sentiment-twitter

Conversation

@rebelchris

Copy link
Copy Markdown
Contributor

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: communitySentiment added to twitterAllowedFields (without it the update whitelist silently strips the column), and tryMapCommunitySentimentPayload invoked mirroring article/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).
  • No typing changes needed: extra.community_sentiment/extra.discussions already live on the shared postUpdated payload type.
  • No migration (column exists on the Post STI 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.ts105 passed. pnpm run lint 0 warnings, pnpm run build clean.

🤖 Generated with Claude Code

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>
@pulumi

pulumi Bot commented Jul 24, 2026

Copy link
Copy Markdown

🍹 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

@rebelchris
rebelchris merged commit 0f80539 into main Jul 24, 2026
9 checks passed
@rebelchris
rebelchris deleted the feat/community-sentiment-twitter branch July 24, 2026 11: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