Removing feed experiment for non-logged in user (#15733)
Related to #15240
This commit is contained in:
parent
ae8d78c571
commit
509b162cd7
1 changed files with 3 additions and 21 deletions
|
|
@ -241,27 +241,9 @@ class StoriesController < ApplicationController
|
|||
@stories = Articles::Feeds::Latest.call
|
||||
else
|
||||
@default_home_feed = true
|
||||
strategy = AbExperiment.get(experiment: :feed_strategy, controller: self, user: current_user,
|
||||
default_value: "original")
|
||||
feed = if strategy.weighted_query_strategy?
|
||||
# I'm uncertain why we don't pass a user here, but it mimics
|
||||
# the behavior of the original LargeForemExperimental.
|
||||
Articles::Feeds::WeightedQueryStrategy.new(user: nil, page: @page, tags: params[:tag])
|
||||
else
|
||||
Articles::Feeds::LargeForemExperimental.new(page: @page, tag: params[:tag])
|
||||
end
|
||||
Datadog.tracer.trace("feed.query",
|
||||
span_type: "db",
|
||||
resource: "#{self.class}.#{__method__}",
|
||||
tags: { feed_class: feed.class.to_s.dasherize }) do
|
||||
# Hey, why the to_a you say? Because the
|
||||
# LargeForemExperimental has already done this. But the
|
||||
# weighted strategy has not. I also don't want to alter the
|
||||
# weighted query implementation as it returns a lovely
|
||||
# ActiveRecord::Relation. So this is a concession.
|
||||
@featured_story, @stories = feed.featured_story_and_default_home_feed(user_signed_in: user_signed_in?)
|
||||
@stories = @stories.to_a
|
||||
end
|
||||
feed = Articles::Feeds::LargeForemExperimental.new(page: @page, tag: params[:tag])
|
||||
@featured_story, @stories = feed.featured_story_and_default_home_feed(user_signed_in: user_signed_in?)
|
||||
@stories = @stories.to_a
|
||||
end
|
||||
|
||||
@pinned_article = pinned_article&.decorate
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue