Commit graph

20 commits

Author SHA1 Message Date
Anna Buianova
51316c747f
Comments count according to display rules in feed (#20753)
* Move calculating comments score from worker to a service

* Display displayed comments count in feed

* Recalculating displayed comments counts on article show (if needed)

* Rubocop fixes

* Fixed lambda
2024-03-28 12:12:05 +00:00
Anna Buianova
d0f3fb6fff
Optimize and test comments cache after score change (#20640)
* Add specs for caching article comments, use cache_key_with_version

* Optimize cache busting for spammer comments, reorganized related specs
2024-02-16 14:53:11 +00:00
Anna Buianova
fb09a75352
Update comment updated_at when changing score (#20622)
* Change comment updated_at when updating comment score

* Rubocop fixes
2024-02-13 13:17:24 +00:00
Ben Halpern
04d4b2340d
Add downstream score effects from spam role (#20498)
* Add downstream score effects from spam role

* Move async score calc down low

* Add tests

* Add stub

* Fix typo

* No need for guard

* No need for guard
2024-01-08 16:25:28 +00:00
Joshua Wehner
2b24167fba
Try fixing comment like count bugs (#18438)
* Try fixing comment like count bugs

* Tests for the CommentCreator
2022-09-12 10:12:46 +02:00
Daniel Uber
b2c7f7a5a3
Use Sidekiq::Job module alias for Sidekiq::Worker (#17526) 2022-05-02 11:12:58 -05:00
Monica Mateiu
6818ef3ed0
Remove references to article.spaminess_rating (#17235)
* Remove references to article.spaminess

* Update app/models/article.rb

* Update spec/workers/comments/calculate_score_worker_spec.rb

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

* remove unnecessary BlackBox spec

* Update spec/workers/comments/calculate_score_worker_spec.rb

Co-authored-by: Jamie Gaskins <jgaskins@hey.com>

* Remove references to calculate_spaminess

* Update app/workers/comments/calculate_score_worker.rb

Co-authored-by: Jamie Gaskins <jgaskins@hey.com>

Co-authored-by: Jeremy Friesen <jeremy.n.friesen@gmail.com>
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
Co-authored-by: Jamie Gaskins <jgaskins@hey.com>
Co-authored-by: Jamie Gaskins <jamie@forem.com>
2022-04-15 11:43:48 -04:00
Alex
7ee8523ba3
Refactor EdgeCache (#11684)
* Refactor EdgeCache

* Update specs

* Add bust comment spec

* Fix more specs

* Use const_get

* Make methods private

* Add .discussion? decorator to Article

* Change variable name to article for clarity
2020-12-02 14:20:22 -05:00
Molly Struve
a16fc46f84
[deploy] Revert "Async Handle Notifications for Comments When Saved (#9680)" (#9686)
This reverts commit 852223dd86.
2020-08-08 20:16:27 -05:00
Molly Struve
852223dd86
[deploy] Async Handle Notifications for Comments When Saved (#9680) 2020-08-08 17:59:17 -05:00
rhymes
5a2cae4fbb
Rubocop: enable and fix new Rails cops (#9537)
* Enable new Rails/* cops and use autocorrect on them

* Fixed Rails/PluckInWhere leftovers

* Fix Rails/DefaultScope

* Enable and fix Rails/PluckId

* Fix manual mistake with forcing autocorrection on Rails/PluckId

* Apply PR feedback to remove Rails/PluckId inline disables

* Apply PR feedback to get rid of Rails/PluckInWhere inline
2020-07-29 11:14:19 +02:00
rhymes
40f54e317f
[deploy] Use Action Mailer parameterized syntax (#8853) 2020-06-23 13:48:41 -05:00
Molly Struve
bac4a3ca4b
Force Unique Jobs for User Initiated Jobs and Cache Jobs (#7688) 2020-05-06 08:27:17 -05:00
Molly Struve
6f4e6fe064
[deploy] ensure that often run sidekiq jobs are unique until they execute (#7168) 2020-04-08 19:19:30 -04:00
Molly Struve
cbe6b3bd70
[deploy] Skip updating a root comment if it doesnt exist (#7080) 2020-04-06 10:18:05 -05:00
rhymes
1bc0469b2d Add article's record key to Fastly Surrogate-Key to separate caches (#5543)
* Add article's record key to Fastly Surrogate-Key to separate caches

After #4744 we successfully setup an auto purging system based on Fastly's surrogate key based cache and purging API.
Unfortunately this worked only in the `:show` action as comments are their own tree-based resource.
The `:index` though, is related to a single article, so without the article's record key in the `Surrogate-Key` header the first time we hit the API the result would become the value stored in Fastly's API, for all articles.

* Fix commentable mock for job spec

* Add comment.commentable.purge to the worker as well

* Add more thorough tests for commentable
2020-01-17 08:45:47 -05:00
Asha Balasubramaniam
81ead4935a Migrate Comments::BustCacheJob to Comments::BustCacheWorker and move to Sidekiq (#5502) 2020-01-16 10:20:13 -05:00
Asha Balasubramaniam
e5960810cc Migrate Comments::SendEmailNotificationJob to Sidekiq (#5427)
* Add sidekiq version of the corresponding delayed job
* Switch the invocation of the delayed job from `after_create` to
`after_create_commit` to avoid the race condition where the worker can
be executed before the comment is persisted. Added covering spec
for this change.
2020-01-10 13:59:12 -06:00
Asha Balasubramaniam
1003f71c8f Migrate delayed job that calculates comment score to sidekiq (#5382) 2020-01-08 14:11:31 -05:00
Pablo Ifrán
783d43b737 Change create first reaction job to worker (#5327) [deploy] 2020-01-02 13:06:53 -05:00