Skip to content

feat: add hasUnreadPosts flag and clearUnreadPosts mutation#2956

Merged
omBratteng merged 16 commits intomainfrom
AS-1172-squads-unread-posts
Aug 5, 2025
Merged

feat: add hasUnreadPosts flag and clearUnreadPosts mutation#2956
omBratteng merged 16 commits intomainfrom
AS-1172-squads-unread-posts

Conversation

@omBratteng
Copy link
Contributor

@omBratteng omBratteng commented Aug 4, 2025

  • Adds hasUnreadPosts to SourceMember flags and expose it in boot
  • Create new mutation clearUnreadPosts that sets new flag to false

TODO:

  • Add worker to set flag to true on new posts
  • Add tests for worker

Jira ticket

AS-1172

@pulumi
Copy link

pulumi bot commented Aug 4, 2025

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

Resource Changes

    Name                                            Type                                  Operation
~   vpc-native-update-views-cron                    kubernetes:batch/v1:CronJob           update
~   vpc-native-update-tag-recommendations-cron      kubernetes:batch/v1:CronJob           update
~   vpc-native-update-source-tag-view-cron          kubernetes:batch/v1:CronJob           update
~   vpc-native-personalized-digest-cron             kubernetes:batch/v1:CronJob           update
~   vpc-native-update-tags-str-cron                 kubernetes:batch/v1:CronJob           update
~   vpc-native-bg-deployment                        kubernetes:apps/v1:Deployment         update
~   vpc-native-hourly-notification-cron             kubernetes:batch/v1:CronJob           update
~   vpc-native-personalized-digest-deployment       kubernetes:apps/v1:Deployment         update
~   vpc-native-ws-deployment                        kubernetes:apps/v1:Deployment         update
~   vpc-native-generate-search-invites-cron         kubernetes:batch/v1:CronJob           update
~   vpc-native-clean-gifted-plus-cron               kubernetes:batch/v1:CronJob           update
+   vpc-native-api-migration-02fbdf86               kubernetes:batch/v1:Job               create
~   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-daily-digest-cron                    kubernetes:batch/v1:CronJob           update
~   vpc-native-temporal-deployment                  kubernetes:apps/v1:Deployment         update
~   vpc-native-calculate-top-readers-cron           kubernetes:batch/v1:CronJob           update
~   vpc-native-clean-zombie-images-cron             kubernetes:batch/v1:CronJob           update
+   api-sub-api.post-added-squad-unread-posts       gcp:pubsub/subscription:Subscription  create
~   vpc-native-sync-subscription-with-cio-cron      kubernetes:batch/v1:CronJob           update
~   vpc-native-clean-stale-user-transactions-cron   kubernetes:batch/v1:CronJob           update
~   vpc-native-private-deployment                   kubernetes:apps/v1:Deployment         update
~   vpc-native-update-highlighted-views-cron        kubernetes:batch/v1:CronJob           update
+-  vpc-native-debezium-deployment                  kubernetes:apps/v1:Deployment         create-replacement
-   vpc-native-api-migration-7a7a5afe               kubernetes:batch/v1:Job               delete
+-  vpc-native-debezium-props                       kubernetes:core/v1:Secret             create-replacement
~   vpc-native-deployment                           kubernetes:apps/v1:Deployment         update
~   vpc-native-clean-zombie-users-cron              kubernetes:batch/v1:CronJob           update
~   vpc-native-update-current-streak-cron           kubernetes:batch/v1:CronJob           update
~   vpc-native-generic-referral-reminder-cron       kubernetes:batch/v1:CronJob           update
~   vpc-native-check-analytics-report-cron          kubernetes:batch/v1:CronJob           update
~   vpc-native-validate-active-users-cron           kubernetes:batch/v1:CronJob           update
~   vpc-native-update-trending-cron                 kubernetes:batch/v1:CronJob           update

@omBratteng omBratteng marked this pull request as ready for review August 4, 2025 14:30
@omBratteng omBratteng requested a review from a team as a code owner August 4, 2025 14:30
Copy link
Contributor

@capJavert capJavert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just few comments to check after you add tests 👍

},
);

return getSourceById(ctx, info, sourceId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to return whole source, seems it can return empty response?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah agreed we don't use it right? so empty probably easier.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use it in frontend to update query state for the squad

Copy link
Contributor Author

@omBratteng omBratteng Aug 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've refactored it now to be a smaller mutation, it just returns true or false depending on affected rows in the update.
Then on front-end, if response is true, I update object

Copy link
Contributor

@rebelchris rebelchris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing blocking from my side.

},
);

return getSourceById(ctx, info, sourceId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah agreed we don't use it right? so empty probably easier.

omBratteng and others added 4 commits August 4, 2025 17:06
Co-authored-by: Ante Barić <ante@kickass.website>
Co-authored-by: Ante Barić <ante@kickass.website>
@omBratteng omBratteng requested a review from capJavert August 4, 2025 15:36
@omBratteng omBratteng requested a review from rebelchris August 5, 2025 06:49
Copy link
Contributor

@rebelchris rebelchris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing blocking from my side.
Would prefer optimized mutation, but it's not a blocker.

@omBratteng omBratteng merged commit 5ead929 into main Aug 5, 2025
9 checks passed
@omBratteng omBratteng deleted the AS-1172-squads-unread-posts branch August 5, 2025 07:36
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.

3 participants