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

Fix follow recommendation biased towards older accounts #17126

Merged
merged 1 commit into from
Dec 13, 2021

Conversation

noellabo
Copy link
Contributor

Currently, the follow recommendations do not show the newly recognized accounts by the server, as the wrong refinement will preferentially select the old account ID. Fix this.

Also, since the boost is included when detecting the language used by the account from the status, the language detection fails in rare cases. Fix this.

Comment on lines +1 to +24
class UpdateAccountSummariesToVersion2 < ActiveRecord::Migration[6.1]
def up
reapplication_follow_recommendations_v2 do
drop_view :account_summaries, materialized: true
create_view :account_summaries, version: 2, materialized: { no_data: true }
safety_assured { add_index :account_summaries, :account_id, unique: true }
end
end

def down
reapplication_follow_recommendations_v2 do
drop_view :account_summaries, materialized: true
create_view :account_summaries, version: 1, materialized: { no_data: true }
safety_assured { add_index :account_summaries, :account_id, unique: true }
end
end

def reapplication_follow_recommendations_v2
drop_view :follow_recommendations, materialized: true
yield
create_view :follow_recommendations, version: 2, materialized: { no_data: true }
safety_assured { add_index :follow_recommendations, :account_id, unique: true }
end
end
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if, instead of the reapplication_follow_recommendations_v2 thing, you can use replace_view instead? Since the columns are exactly the same in the same order, I think this should work.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, no this is not possible. This is only possible for non-materialized views.

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'm looking forward to scenic's update_view reducing this verbose description, but not yet.
scenic-views/scenic#218

@Gargron Gargron merged commit bda8e4f into mastodon:main Dec 13, 2021
@noellabo noellabo deleted the fix-follow-recommendation-biased branch December 13, 2021 23:27
jesseplusplus pushed a commit to jesseplusplus/decodon that referenced this pull request Feb 10, 2022
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.

None yet

3 participants