docbrown/spec/services
rhymes 83852038e4
[Search 2.0] Reading list (#13052)
* Step one in populating the reading list with PG

This first attempt tries to recycle the `Search::ArticleSerializer` which is only
used in input in ES, but we're using it in output in PG.
For this reason it's currently 15.55x times slower

* Serialize only what is requested by the frontend

`Search::ArticleSerializer` which is only used in ES in the indexing step aims
to add as much info as possible for broader purposes, in this case
(with serialization in output) we should aim to save only what's requested from
the frontend.

* Optimize selection of articles columns

* Select only needed columns for users

* Compute total of reading list items

* Attach the basic filtering based on PG on the search controller

* Restructure in methods

* Add tags support

* Use LIKE on articles.cached_tag_list

* Fix tags as nil

* Fix default pagination

* Add optional FTS for reading list

* Reworded the tags comment explaining why

* Add index to reactions.status

* Fix total counter in Preact readingList component

* Fix total count in reading list backend search

* Add GIN index to articles.cached_tag_list

* Add service tests

* Add search request specs

* Added missing early return

* Update spec/requests/search_spec.rb

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

* Extract MAX_PER_PAGE constant and add comments

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
2021-03-24 15:40:00 +01:00
..
articles Optimize Article.published scope to use an index (#13071) 2021-03-23 13:07:27 -04:00
audit Remove Audit::Event::Util (#8704) 2020-06-16 12:50:53 -04:00
authentication Abstract DatadogStatsClient to ForemStatsClient (#12304) 2021-01-27 11:25:44 -05:00
badges Split BadgeRewarder into multiple services (#11902) 2020-12-23 09:55:06 -05:00
broadcasts/welcome_notification Routine Rubocop fixes (#12016) 2020-12-23 10:26:12 -05:00
chat_channels Rubocop: Enable and fix Style/StringConcatenation (#9844) 2020-08-18 14:50:15 +02:00
color Move HexComparer to Hex::Comparer service (#12202) 2021-01-12 11:34:30 -05:00
credits Refactoring user_controller separating some classes to service (#10384) 2020-10-05 10:41:59 +02:00
data_sync/elasticsearch Reindex comments' Elasticsearch doc when commentable is updated (#12330) 2021-01-20 09:44:59 -05:00
edge_cache Refactor cache purging (#12811) 2021-03-02 10:09:05 -05:00
exporter Remove language settings (#12502) 2021-02-04 08:35:00 +07:00
fastly_config Abstract DatadogStatsClient to ForemStatsClient (#12304) 2021-01-27 11:25:44 -05:00
feeds ✂️ Remove the approvals gem ✂️ (#12978) 2021-03-19 13:28:06 -07:00
follows Move app/labor/follow_checker.rb to service (#11613) 2020-12-01 14:14:36 +07:00
giphy Adjust type tags for RSpec (#4864) 2019-11-20 13:01:30 -05:00
github Don't use "not_to raise_error" with specific class (#10602) 2020-10-05 17:29:01 +02:00
html Move CodeBlockParse and MarkdownParser to service (#12112) 2021-01-07 10:13:01 -05:00
images Bump imgproxy to 2.0 (#12963) 2021-03-11 08:24:13 -05:00
loggers Move LogWorkerQueueStats from labor to services (#11642) 2020-11-30 09:31:15 +07:00
mailchimp Parenthesis consistency for add_role and remove_role (#12661) 2021-02-15 20:35:25 +02:00
markdown_processor Fix Markdown parsing of <code> tag (#12797) 2021-03-03 17:41:56 +01:00
mentions [deploy] Finalize deleting user associations (#5624) 2020-01-23 11:29:47 -05:00
moderator reenable article rescoring when moderators flag users (#12983) 2021-03-16 14:04:13 -05:00
notifications Change PushNotifications::Send to use user_ids (#13036) 2021-03-19 13:50:04 -06:00
payments Abstract DatadogStatsClient to ForemStatsClient (#12304) 2021-01-27 11:25:44 -05:00
podcasts [deploy] Ensure podcast episodes are created with processed_html (#10715) 2020-10-07 12:09:36 -04:00
profile_fields Fix profile field production display area functionality and remove SiteConfig.dev_to? hacks for better generalization (#12015) 2021-02-11 10:05:06 -05:00
profiles Remove looking for work columns (#12173) 2021-01-11 11:22:39 +07:00
push_notifications Change PushNotifications::Send to use user_ids (#13036) 2021-03-19 13:50:04 -06:00
re_captcha Split ReCaptcha service and use verbs instead of pronouns (#11706) 2020-12-02 16:50:42 -06:00
search [Search 2.0] Reading list (#13052) 2021-03-24 15:40:00 +01:00
secrets Use a sortable unique ID for the event_id (#3972) 2019-09-09 10:15:12 -04:00
slack Update article published Slack notifications (#12579) 2021-02-05 09:19:05 -05:00
suggester/users Refactor:Replace Production Check with Average Metrics (#11096) 2020-11-12 10:03:10 -06:00
tag_moderators Move AssignTagModerator from labor to services (#11826) 2020-12-17 09:51:26 +07:00
twitter_client Use SiteConfig twitter keys before env (#12200) 2021-01-11 12:01:37 -05:00
user_blocks Rubocop: move dot in multi-line calls to leading position (#9262) 2020-07-16 15:51:11 +02:00
user_subscriptions Update CODEOWNERS and team names in TODO comments (#9460) 2020-07-24 12:17:20 +07:00
users Remove buffer gem and related code: step 1 (#12993) 2021-03-24 09:58:38 +07:00
webhook [deploy] Rubocop: fix violations of Layout/LineLength (#9197) 2020-07-08 08:36:36 -05:00
analytics_service_spec.rb Flaky Spec Fix:Ensure Page View Domains are Unique for Analytics Service Spec (#10329) 2020-09-14 13:41:14 -05:00
article_with_video_creation_service_spec.rb Fix invalid body_markdown in article with video (#4258) [ci skip] 2019-10-08 15:41:44 -04:00
bulk_sql_delete_spec.rb Routine rubocop fixes (#10237) 2020-09-08 12:06:47 -04:00
email_digest_article_collector_spec.rb [deploy] Optimization:Select Article Columns for Digest Email, Limit 6, Use User Attributes (#10147) 2020-09-02 11:31:43 -05:00
email_digest_spec.rb Refactor:Use dev_to? to Check for DEV (#12083) 2020-12-30 14:34:00 -06:00
feature_flag_spec.rb Replace calls to Flipper with FeatureFlag (#11386) 2020-11-12 14:15:33 +01:00
flare_tag_spec.rb [deploy] Optimization: Dont Use Redis For Flare Tag IDs, Load Them On Boot (#8987) 2020-06-30 09:48:08 -05:00
medium_article_retrieval_service_spec.rb Nokogiri::HTML should receive the body, not the response object (#5297) 2019-12-31 08:46:49 -05:00
rate_limit_checker_spec.rb Add rate limit for new user comments (#12925) 2021-03-16 08:39:31 +07:00
tag_adjustment_creation_service_spec.rb nothing to see here....except maybe reverting a push to master (#8308) 2020-06-05 20:34:21 -05:00
tag_adjustment_update_service_spec.rb nothing to see here....except maybe reverting a push to master (#8308) 2020-06-05 20:34:21 -05:00