Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upLists #5703
Conversation
Gargron
added
api
work in progress
labels
Nov 15, 2017
Gargron
added some commits
Nov 15, 2017
Gargron
removed
the
work in progress
label
Nov 16, 2017
nightpool
requested changes
Nov 16, 2017
needs an update to remove_status_service_spec for Feed -> HomeFeed.
needs a corresponding /documentation PR
| + render_views | ||
| + | ||
| + let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } | ||
| + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'follow') } |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| + def initialize(list) | ||
| + @type = :list | ||
| + @id = list.id | ||
| + end |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| @@ -0,0 +1,13 @@ | ||
| +# frozen_string_literal: true | ||
| + | ||
| +class ListPolicy < ApplicationPolicy |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
nightpool
Nov 16, 2017
Collaborator
Is this ever used by Doorkeeper? I couldn't find any indication that doorkeeper checked pundit policies....
nightpool
Nov 16, 2017
Collaborator
Is this ever used by Doorkeeper? I couldn't find any indication that doorkeeper checked pundit policies....
| @@ -27,33 +27,41 @@ def filter?(timeline_type, status, receiver_id) | ||
| end | ||
| def push(timeline_type, account, status) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
nightpool
Nov 16, 2017
Collaborator
Considering that we only ever use push(:home) (as far as I can tell....) and we're adding a push_to_list anyway, we should probably make a push_to_home method, and then either get rid of push or make it private and get rid of any code duplication between it and push_to_list
(same with unpush)
nightpool
Nov 16, 2017
•
Collaborator
Considering that we only ever use push(:home) (as far as I can tell....) and we're adding a push_to_list anyway, we should probably make a push_to_home method, and then either get rid of push or make it private and get rid of any code duplication between it and push_to_list
(same with unpush)
nightpool
requested review from
nightpool
and removed request for
nightpool
Nov 16, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
cwebber
commented
Nov 16, 2017
|
Any thought of exposing these as AS2 Collections? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
nightpool
Nov 17, 2017
Collaborator
@cwebber right now lists are entirely private and no one else can see them. If we add other functionality then we might consider that
|
@cwebber right now lists are entirely private and no one else can see them. If we add other functionality then we might consider that |
aschmitz
reviewed
Nov 17, 2017
This looks reasonably good overall. The bulk endpoint is apparently new, so it would be good to make sure it's appropriately documented. A few minor comments for possible changes, but I don't know that any of them are really necessary.
| @@ -30,15 +31,25 @@ def call(status) | ||
| def deliver_to_self(status) | ||
| Rails.logger.debug "Delivering status #{status.id} to author" | ||
| - FeedManager.instance.push(:home, status.account, status) | ||
| + FeedManager.instance.push_to_home(status.account, status) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| - | ||
| - PushUpdateWorker.perform_async(account.id, status.id) if push_update_required?(timeline_type, account.id) | ||
| - | ||
| + def push_to_home(account, status) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
aschmitz
Nov 17, 2017
Contributor
Is there a good reason to call push_to_home and push_to_list separately outside of FeedManager? Should we just expose push_to_user and let FeedManager sort out lists? (This seems less efficient, but perhaps cleaner. I can see arguments on either side.)
aschmitz
Nov 17, 2017
Contributor
Is there a good reason to call push_to_home and push_to_list separately outside of FeedManager? Should we just expose push_to_user and let FeedManager sort out lists? (This seems less efficient, but perhaps cleaner. I can see arguments on either side.)
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Gargron
Nov 17, 2017
Member
As I started writing the code, the push behaviour was different enough that I had to create a separate push_to_list method. But as I refactored, they turned out pretty similar after all. However, I am absolutely OK with keeping them separate for now. As they say, the DRY principle kicks in for n >= 3
Gargron
Nov 17, 2017
Member
As I started writing the code, the push behaviour was different enough that I had to create a separate push_to_list method. But as I refactored, they turned out pretty similar after all. However, I am absolutely OK with keeping them separate for now. As they say, the DRY principle kicks in for n >= 3
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
nightpool
Nov 17, 2017
Collaborator
My thought was that it mirrors push_to_hashtag, which isn't in feed_manager but does need to happen
nightpool
Nov 17, 2017
Collaborator
My thought was that it mirrors push_to_hashtag, which isn't in feed_manager but does need to happen
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
nightpool
Nov 17, 2017
Collaborator
Yes, but it mirrors the necessity of calling all of those different functions (see the calling site)
nightpool
Nov 17, 2017
Collaborator
Yes, but it mirrors the necessity of calling all of those different functions (see the calling site)
| + allow(controller).to receive(:doorkeeper_token) { token } | ||
| + end | ||
| + | ||
| + context 'with a user context' do |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
aschmitz
Nov 17, 2017
Contributor
It may be worth testing with a different user's context as well, to ensure the list isn't accidentally exposed.
aschmitz
Nov 17, 2017
Contributor
It may be worth testing with a different user's context as well, to ensure the list isn't accidentally exposed.
| +require 'rails_helper' | ||
| + | ||
| +RSpec.describe ListAccount, type: :model do | ||
| + pending "add some examples to (or delete) #{__FILE__}" |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ThibG
self-requested a review
Nov 17, 2017
ThibG
reviewed
Nov 17, 2017
I'm confused about the bigint VS integer things and I wonder about not having a method to load lists from database when Redis cache doesn't exist
| @@ -3,7 +3,7 @@ | ||
| # | ||
| # Table name: accounts | ||
| # | ||
| -# id :bigint not null, primary key | ||
| +# id :integer not null, primary key | ||
| # username :string default(""), not null |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
nightpool
Nov 17, 2017
Collaborator
These model annotations are auto-generated. I've deleted the rest of your comments because they're not a concern.
nightpool
Nov 17, 2017
Collaborator
These model annotations are auto-generated. I've deleted the rest of your comments because they're not a concern.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ThibG
Nov 17, 2017
Collaborator
Right. Still, noisy for no reason, and I don't understand why they would be generated that way? db/schema.rb seems fine, though.
ThibG
Nov 17, 2017
Collaborator
Right. Still, noisy for no reason, and I don't understand why they would be generated that way? db/schema.rb seems fine, though.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Gargron
Nov 17, 2017
Member
Every db:migrate is gonna reset these to this. So I'd rather have them wrong than deal with noise in every PR. I shouldn't have merged #5461 but I did not realize annotate would not pick up the correct types, thought something just got forgotten because of the unusual way we performed the snowflake migrations.
Gargron
Nov 17, 2017
Member
Every db:migrate is gonna reset these to this. So I'd rather have them wrong than deal with noise in every PR. I shouldn't have merged #5461 but I did not realize annotate would not pick up the correct types, thought something just got forgotten because of the unusual way we performed the snowflake migrations.
| + def initialize(list) | ||
| + @type = :list | ||
| + @id = list.id | ||
| + end |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tootsuite
deleted a comment from
ThibG
Nov 17, 2017
tootsuite
deleted a comment from
ThibG
Nov 17, 2017
tootsuite
deleted a comment from
ThibG
Nov 17, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Still needs |
Gargron
merged commit 24cafd7
into
master
Nov 17, 2017
Gargron
deleted the
feature-lists
branch
Nov 17, 2017
added a commit
to glitch-soc/mastodon
that referenced
this pull request
Nov 17, 2017
rinsuki
referenced this pull request
in cinderella-project/iMast
Nov 22, 2017
Merged
Support Lists #72
This was referenced Dec 5, 2017
pushed a commit
to cobodo/mastodon
that referenced
this pull request
Dec 6, 2017
aquariusdev
referenced this pull request
in glitch-soc/mastodon
Apr 18, 2018
Open
feature outline: Lists #12
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
aquariusdev
commented
Apr 18, 2018
•
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Cassolotl
Apr 18, 2018
@aquariusdev Since this is a pull request that was merged a while ago, it's probably best to create a new issue for your feature request!
Cassolotl
commented
Apr 18, 2018
•
|
@aquariusdev Since this is a pull request that was merged a while ago, it's probably best to create a new issue for your feature request! |



Gargron commentedNov 15, 2017
•
edited
Edited 8 times
-
Gargron
edited Nov 16, 2017 (most recent)
-
Gargron
edited Nov 16, 2017
-
Gargron
edited Nov 16, 2017
-
Gargron
edited Nov 16, 2017
-
Gargron
edited Nov 16, 2017
-
Gargron
edited Nov 16, 2017
-
Gargron
edited Nov 16, 2017
-
Gargron
edited Nov 16, 2017
Fix #134
Web UI implementation should come in a different PR.
New APIs:
GET /api/v1/timelines/list/:idTimeline of a listGET /api/v1/listsAll your listsPOST /api/v1/listsCreate a new list (allowed param:title)GET/PUT/DELETE /api/v1/lists/:idGET /api/v1/lists/:id/accountsAll accounts in the listPOST/DELETE /api/v1/lists/:id/accountsAdd or remove accounts to/from the list (array param:account_ids)New streaming API:
/api/v1/streaming/list?list=:idSubscribe to list timelineOther information: