Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split up question worker to send to an individual user rather than to all followers #1442

Merged
merged 8 commits into from
Dec 11, 2023

Conversation

raccube
Copy link
Contributor

@raccube raccube commented Nov 1, 2023

Closes #810

@raccube raccube added the refactor Rework of an existing piece of code or functionality label Nov 1, 2023
Copy link

codecov bot commented Nov 1, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (117a595) 95.41% compared to head (b2b9826) 95.70%.
Report is 131 commits behind head on main.

❗ Current head b2b9826 differs from pull request most recent head e481721. Consider uploading reports for the commit e481721 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1442      +/-   ##
==========================================
+ Coverage   95.41%   95.70%   +0.29%     
==========================================
  Files         174      174              
  Lines        2702     2699       -3     
==========================================
+ Hits         2578     2583       +5     
+ Misses        124      116       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@raccube raccube force-pushed the refactor/send-to-followers-individually branch from 1500880 to b193ad2 Compare November 1, 2023 21:51
user = User.find(user_id)
question = Question.find(question_id)
def perform(follower_id, question_id)
follower = User.includes(:web_push_subscriptions, :mute_rules, :muted_users).find(follower_id)
Copy link
Member

Choose a reason for hiding this comment

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

one minor concern i have is that during deployment there may be still some QuestionWorker jobs that expect the first parameter to be the user id who asked the question, which will eventually end up as them asking the question themselves.

perhaps we can keep the old QuestionWorker as a fallback, and rename this worker to something else (QuestionJob maybe -- Sidekiq nowadays prefers to use *Job instead of *Worker https://github.com/sidekiq/sidekiq/blob/main/lib/sidekiq/worker_compatibility_alias.rb)

Copy link
Member

@nilsding nilsding 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 overall though

@raccube raccube merged commit 5d89e21 into main Dec 11, 2023
10 checks passed
@raccube raccube deleted the refactor/send-to-followers-individually branch December 11, 2023 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Rework of an existing piece of code or functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split up question worker to send to an individual user rather than to all followers
3 participants