Navigation Menu

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

Change REST API to return empty data for suspended accounts #14765

Merged
merged 1 commit into from Sep 11, 2020

Conversation

Gargron
Copy link
Member

@Gargron Gargron commented Sep 9, 2020

  • Instead of HTTP 410, return empty account with { ... "suspended": true ... } in REST API
  • Exclude suspended accounts from queries
  • Return empty results instead of account's data

@Gargron Gargron added the api REST API, Streaming API, Web Push API label Sep 9, 2020
Copy link
Contributor

@ClearlyClaire ClearlyClaire left a comment

Choose a reason for hiding this comment

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

It looks mostly fine to me, except:

  • I don't think suspended users should be hidden from someone's own followers/followed accounts, muted etc.: let people manage their relationship with people who have been suspended
  • I'd like additional tests, especially around the default URL thing
  • this whole thing is definitely acceptable as a first state, but i wouldn't accept it in a release that doesn't handle federating the fact that an account is suspended, otherwise this may lead to confusion as you wouldn't know a remote account is indeed suspended

accounts = Account.where(id: account_ids).select('id')
accounts = Account.without_suspended.where(id: account_ids).select('id')
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, maybe this should keep suspended accounts, so one can unfollow/block/etc. suspended accounts while those are suspended, in case they get reinstated.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm going for consistency with previous behaviour. Previous behaviour where account data was deleted immediately meant that all following/muting/blocking/etc relationships were erased the moment the account was suspended. And unless the suspension is cancelled within 30 days, all of it will still be deleted in the end. So it makes sense for me to keep it that way. If an account is unsuspended, then other users may worry about following/unfollowing/muting/unmuting etc.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, but we're precisely changing the behavior here, to have suspension not be necessarily definitive. Regardless of the 30 days thing (which isn't implemented yet, and, depending on how federation is handled, might not be handled the same way by remote instances).

Copy link
Member Author

Choose a reason for hiding this comment

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

No, it is implemented in the other PR.

If another server does not handle suspension the same way, then the account will not look suspended there and their users will be able to continue to unfollow, mute, and block without issue. Then after 30 days or earlier, the Delete will arrive there.

Copy link
Contributor

Choose a reason for hiding this comment

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

I meant, if another implementation federates the suspension info but doesn't implement the 30 days-to-delete thing (either having a longer delay or no automatic deletion at all), there is no bound between the time an account is suspended and the time an account is reinstated. This can be very surprising if you have a “suspended” follower not listed anymore and they reappear months ago from seemingly nowhere.

Copy link
Member Author

Choose a reason for hiding this comment

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

I fear that by including suspended users on followers lists and allowing following/unfollowing them it takes away from the seriousness of a suspension in the eyes of the users. Imagine "Why is @Hitler8814 still in my followers, I have to block them myself?! This platform does nothing!"

You bring up a good point, what if another (malicious) server marks an account as suspended but allows that account to operate as normal, in that case the lacking controls would become a liability. But I propose that we move that discussion to federation of suspensions. While suspensions do not federate, a suspended account is merely a normal account on other servers up until it is deleted as usual.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess following shouldn't be allowed, but muting, blocking, unfollowing should.

Good point about an obviously offending account still appearing in followers. I was more viewing it from the perspective ofs someone with a locked account, and considering an account that isn't obviously offensive but has been suspended for reasons I may or may not be aware of. I am unsure what the exact solution for this should be, but I'm still uncomfortable with the following relationship being hidden from me, the person being followed or following them.

Copy link
Member Author

Choose a reason for hiding this comment

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

Following a suspended account is already not possible but I didn't change anything about MuteService, BlockService or UnfollowService so interacting with suspended accounts directly that way is possible.

Comment on lines +21 to +22
.joins(:target_account)
.merge(Account.without_suspended)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is probably fine in the blocks controller, but as above, I would prefer if an un-suspended user could still manage their relationships with a suspended user.

Comment on lines -40 to +42
@list.accounts.includes(:account_stat).all
@list.accounts.without_suspended.includes(:account_stat).all
else
@list.accounts.includes(:account_stat).paginate_by_max_id(limit_param(DEFAULT_ACCOUNTS_LIMIT), params[:max_id], params[:since_id])
@list.accounts.without_suspended.includes(:account_stat).paginate_by_max_id(limit_param(DEFAULT_ACCOUNTS_LIMIT), params[:max_id], params[:since_id])
Copy link
Contributor

Choose a reason for hiding this comment

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

As above, I think this falls within “letting users manage relationships with suspended users”.

Comment on lines +21 to +22
.joins(:target_account)
.merge(Account.without_suspended)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as for mutes.

Comment on lines +66 to +72
def locked
object.suspended? ? false : object.locked
end

def bot
object.suspended? ? false : object.bot
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure about those two. I understand the “blank account” thing but I'm not sure about reverting those. Also, if overwriting those, “locked” may make a bit more sense as true.

Copy link
Member Author

Choose a reason for hiding this comment

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

Again, mostly consistency with old behaviour. These values were reset during suspension so it makes sense for me to emulate it here.

@Gargron
Copy link
Member Author

Gargron commented Sep 10, 2020

this whole thing is definitely acceptable as a first state, but i wouldn't accept it in a release that doesn't handle federating the fact that an account is suspended, otherwise this may lead to confusion as you wouldn't know a remote account is indeed suspended

I think this would be an appropriate critique for the PR this was extracted from but not this one. I am splitting the work in smaller chunks to make reviewing easier, so of course a single chunk will not be release-ready.

@ClearlyClaire
Copy link
Contributor

I think this would be an appropriate critique for the PR this was extracted from but not this one. I am splitting the work in smaller chunks to make reviewing easier, so of course a single chunk will not be release-ready.

I completely agree, and I just wanted to make that clear. Also, I'm somewhat worried about that seemingly being tied to the current suspended_at boolean (thus not being able to distinguish between a remote suspension and a local one) but I expect this will be addressed by the AP-related PR.

@Gargron Gargron merged commit e6b272e into master Sep 11, 2020
@Gargron Gargron deleted the feature-suspended-api branch September 11, 2020 13:16
thenameisnigel-old pushed a commit to ChatterlyOSE/Chatterly that referenced this pull request Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api REST API, Streaming API, Web Push API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants