Skip to content

feat: fulfill contribution rewards#3944

Merged
idoshamun merged 1 commit into
mainfrom
codex/contribution-reward-fulfillment
Jun 16, 2026
Merged

feat: fulfill contribution rewards#3944
idoshamun merged 1 commit into
mainfrom
codex/contribution-reward-fulfillment

Conversation

@idoshamun

Copy link
Copy Markdown
Member

What changed

  • Added automatic fulfillment for contribution reward tiers of type cores and plus_days.
  • Cores rewards now create a deterministic Njord-backed UserTransaction from the system user and mark the claim fulfilled after transfer succeeds.
  • Plus-day rewards now grant expiring Plus access through subscriptionFlags, reusing the existing gifted Plus cleanup path.
  • Manual reward types (call, privilege, custom) continue to stay claimed until fulfilled through the private route.

Why

Users could claim giveback rewards, but the claim only created a tracking row. Backend-supported rewards now actually grant the user benefit at claim time.

Validation

  • NODE_ENV=test npx jest __tests__/contributions.ts __tests__/routes/private/contributions.ts --testEnvironment=node --runInBand
  • pnpm run build
  • pnpm run lint

Note: the focused Jest run passed and still emitted the existing force-exit/open-handle warning after completion.

@pulumi

pulumi Bot commented Jun 16, 2026

Copy link
Copy Markdown

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

✨ Neo Code Review

Standard image rollout deploying the contribution reward fulfillment feature, which adds Cores (Njord) and Plus-days reward types with supporting DB migrations. ✅ Low Risk

This is a routine application deployment rolling out the new contribution reward fulfillment feature (commit 29165a54). All deployments and cron jobs are simply picking up the new container image. The two migration Jobs (DB and Clickhouse) are being rotated to the new commit hash — the previous Jobs are deleted and new ones created, which is the standard pattern here.

🔵 Info — The new ContributionReward transaction type (contribution_reward) added to UserTransactionType requires a database migration. The vpc-native-api-db-migration-29165a54 Job will run this migration on deploy. The Clickhouse migration job also runs, though the diff doesn't show a schema change there — it may be a no-op or a related analytics table update.

🔵 Info — The reward fulfillment logic now immediately attempts to fulfill rewards (Cores via Njord, Plus days via subscription flags) at claim time rather than leaving them in a claimed state. Existing claimed rewards will be fulfilled on the next claimContributionReward call due to the idempotency check in fulfillContributionReward. The Cores path uses a deterministic UUIDv5 transaction ID to prevent double-crediting.

Resource Changes

    Name                                                       Type                           Operation
+   vpc-native-api-db-migration-29165a54                       kubernetes:batch/v1:Job        create
-   vpc-native-api-clickhouse-migration-ede6fe3d               kubernetes:batch/v1:Job        delete
~   vpc-native-update-current-streak-cron                      kubernetes:batch/v1:CronJob    update
~   vpc-native-validate-active-users-cron                      kubernetes:batch/v1:CronJob    update
~   vpc-native-ws-deployment                                   kubernetes:apps/v1:Deployment  update
~   vpc-native-post-analytics-clickhouse-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-check-analytics-report-cron                     kubernetes:batch/v1:CronJob    update
~   vpc-native-user-profile-analytics-history-clickhouse-cron  kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-images-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-users-cron                         kubernetes:batch/v1:CronJob    update
~   vpc-native-update-trending-cron                            kubernetes:batch/v1:CronJob    update
~   vpc-native-squad-posts-analytics-refresh-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-clean-zombie-user-companies-cron                kubernetes:batch/v1:CronJob    update
~   vpc-native-update-source-public-threshold-cron             kubernetes:batch/v1:CronJob    update
~   vpc-native-channel-digests-cron                            kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-channel-highlights-cron                   kubernetes:batch/v1:CronJob    update
-   vpc-native-api-db-migration-ede6fe3d                       kubernetes:batch/v1:Job        delete
~   vpc-native-rotate-daily-quests-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-materialize-monthly-best-post-archives-cron     kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-gifted-plus-cron                          kubernetes:batch/v1:CronJob    update
~   vpc-native-generate-search-invites-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-opportunities-cron                 kubernetes:batch/v1:CronJob    update
~   vpc-native-sync-subscription-with-cio-cron                 kubernetes:batch/v1:CronJob    update
~   vpc-native-calculate-top-readers-cron                      kubernetes:batch/v1:CronJob    update
~   vpc-native-user-posts-analytics-refresh-cron               kubernetes:batch/v1:CronJob    update
~   vpc-native-rotate-weekly-quests-cron                       kubernetes:batch/v1:CronJob    update
~   vpc-native-bg-deployment                                   kubernetes:apps/v1:Deployment  update
~   vpc-native-worker-job-deployment                           kubernetes:apps/v1:Deployment  update
~   vpc-native-deployment                                      kubernetes:apps/v1:Deployment  update
~   vpc-native-generic-referral-reminder-cron                  kubernetes:batch/v1:CronJob    update
+   vpc-native-api-clickhouse-migration-29165a54               kubernetes:batch/v1:Job        create
~   vpc-native-update-tag-materialized-views-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-private-deployment                              kubernetes:apps/v1:Deployment  update
~   vpc-native-post-analytics-history-day-clickhouse-cron      kubernetes:batch/v1:CronJob    update
~   vpc-native-daily-digest-cron                               kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-old-notifications-cron                    kubernetes:batch/v1:CronJob    update
~   vpc-native-temporal-deployment                             kubernetes:apps/v1:Deployment  update
... and 14 other changes

@idoshamun idoshamun marked this pull request as ready for review June 16, 2026 10:58
@idoshamun idoshamun merged commit a9f39b0 into main Jun 16, 2026
8 checks passed
@idoshamun idoshamun deleted the codex/contribution-reward-fulfillment branch June 16, 2026 10:59
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