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

Ensure replied-to is a status not a boost #9129

Merged
merged 5 commits into from
Nov 25, 2018
Merged

Ensure replied-to is a status not a boost #9129

merged 5 commits into from
Nov 25, 2018

Conversation

valerauko
Copy link
Contributor

@valerauko valerauko commented Oct 28, 2018

Issue

Fixes #8794

Outline

If the given in-reply-to status is a boost, use the ID of the original status for replying.

To do

  • tests for this specific case

@puckipedia
Copy link
Contributor

so, suggestion, do the same thing reblogs do, so this isn't just fixed on the API side but on the federation side too:
https://github.com/tootsuite/mastodon/blob/6ee779a072c48ef81541cb895dfba873cc1b00d5/app/models/status.rb#L426-L428
and
https://github.com/tootsuite/mastodon/blob/6ee779a072c48ef81541cb895dfba873cc1b00d5/app/models/status.rb#L237

(it's also less code :P)

@valerauko
Copy link
Contributor Author

valerauko commented Oct 28, 2018

I thought it's the same thing, I just put it in the creation service instead of a pre-save macro.

You say this belongs in the model instead?

@puckipedia
Copy link
Contributor

it's not the same thing. I can still send a s2s Create of a Note that is inReplyTo a boost. I think it's better in the model, because it fixes it in all cases, not just this single edge case.

@valerauko
Copy link
Contributor Author

That's my lack of understanding then. Gonna adjust.

@valerauko
Copy link
Contributor Author

Moved to model.

@Gargron
Copy link
Member

Gargron commented Nov 23, 2018

@nightpool @ThibG Thoughts? I'm not sure replying to boosts is a bug, we certainly aren't taking advantage of it in the UI, but I'm not sure if we never will.

@nightpool
Copy link
Member

hmm. I'm worried that by merging this, we'd be encouraging client developers to be loose about boost/original IDs in other places as well.

@nightpool
Copy link
Member

however, since we already do this for boosting posts, maybe there's an argument that we should do it for replies for symmetry

@valerauko
Copy link
Contributor Author

I don't have any strong feelings about this, but I'd like to make some points:

  • validating user input doesn't mean encouraging invalid input
  • the current behaviour results in unexpected UX on the front
  • it's literally a one-line change so if you ever want to implement separate conversation threads for boosts it's no effort to revert

@ClearlyClaire
Copy link
Contributor

I'm fine with this. We aren't storing AP objects anyway, it makes sense to change this in the model for our purposes.

@@ -434,6 +434,9 @@ def set_visibility
end

def set_conversation
# clients might send the ID of the boost itself instead of the boosted status
Copy link
Member

Choose a reason for hiding this comment

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

I think this comment is unnecessary

@Gargron Gargron merged commit db9aea3 into mastodon:master Nov 25, 2018
@valerauko valerauko deleted the prevent-boost-reply branch November 27, 2018 13:06
hiyuki2578 pushed a commit to ProjectMyosotis/mastodon that referenced this pull request Oct 2, 2019
* Ensure replied-to is a status not a boost

* Consider case of not a reply

* Add test case for replying to boost

* Move reblog-reply resolution to model

* Remove unnecessary comment
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

5 participants