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

API response changes on #5762 broke many apps #5856

Closed
1 task done
unarist opened this issue Nov 30, 2017 · 5 comments · Fixed by #5887
Closed
1 task done

API response changes on #5762 broke many apps #5856

unarist opened this issue Nov 30, 2017 · 5 comments · Fixed by #5887
Labels
api REST API, Streaming API, Web Push API bug Something isn't working

Comments

@unarist
Copy link
Contributor

unarist commented Nov 30, 2017

quote from #5762:

As with the notification muting, this will now return an object ({reblogs: [true|false]}) or false for each follow relationship when requesting relationship information for an account. This should cause few issues due to an object being truthy in many languages, but some modifications may need to be made in pickier languages.

Before:

[{
  "id": "1",
  "following": true,
  "followed_by": true,
  "blocking": false,
  "muting": false,
  "requested": false,
  "domain_blocking": false
}]

After:

[{
  "id": "1",
  "following": {
    "reblogs": true
  },
  "followed_by": true,
  "blocking": false,
  "muting": false,
  "requested": false,
  "domain_blocking": false
}]

Then, when I open followee's profile on iOS apps...

  • Amaroq crashed
  • Pawoo couldn't show any relationsips, and follow/unfollow button disappears
  • iMast, Tootle, friends.nico show as "not following"

also my friends says Tusky and SubwayTooter are also broken. I think those breaking change shouldn't be happen on Mastodon 2.1 because it's not a major version up.


  • I searched or browsed the repo’s other issues to ensure this is not a duplicate.
  • [-] This bug happens on a tagged release and not on master (If you're a user, don't worry about this).
@unarist unarist added api REST API, Streaming API, Web Push API bug Something isn't working labels Nov 30, 2017
@nightpool
Copy link
Member

nightpool commented Nov 30, 2017

@Gargron @aschmitz interested to hear your thoughts, but I'm guessing the cleanest way to fix this is to just make it a new property instead: "muting_reblogs" or "following_reblogs"

adding an entire new endpoint version number for something that's really such a simple change and can be done in a backwards compatible way seems excessive.

@aschmitz
Copy link
Contributor

aschmitz commented Nov 30, 2017 via email

@Gargron
Copy link
Member

Gargron commented Nov 30, 2017

Hm, okay, maybe I made the wrong call... But neither of the API changes is in a release yet, are they? If I remember correctly, the optional notification muting PR did not make it in time for 2.0.0. If everyone agrees, I will restore the old response format on the v1 methods and create equivalent v2 methods.

@unarist @aschmitz @nightpool

adding an entire new endpoint version number for something that's really such a simple change and can be done in a backwards compatible way seems excessive.

Well, I thought it'd be backwards-compatible because of "truthiness" in JavaScript and Ruby, but to be fair any typed language like Java will throw its hands up into the air at a slight structure change. I think if we just see the v1/v2 in the API URL as versioning of the individual end-points and not versioning of the entire API, nor as something connected to the software version, then it's fine to do this.

@aschmitz
Copy link
Contributor

aschmitz commented Nov 30, 2017 via email

@nightpool
Copy link
Member

nightpool commented Nov 30, 2017

yeah making it a v2 endpoint feels really premature—it's a pretty small compromise for no real reason. (also it'd affect a bunch of endpoints I think?)

@Gargron Gargron mentioned this issue Dec 5, 2017
10 tasks
aschmitz added a commit to aschmitz/mastodon that referenced this issue Dec 5, 2017
This closes mastodon#5856 by restoring the existing behavior of the `muting`
and `following` keys (returning booleans rather than truthy or false).
It adds `showing_reblogs` and `muting_notifications` keys:

* `showing_reblogs` returns true if:
  1. You've requested to follow the user, with reblogs shown, or
  2. You are following the user, with reblogs shown.
* `muting_notifications` returns true if you have muted the user and
  their notifications as well.
Gargron pushed a commit that referenced this issue Dec 6, 2017
* Break out nested relationship API keys

This closes #5856 by restoring the existing behavior of the `muting`
and `following` keys (returning booleans rather than truthy or false).
It adds `showing_reblogs` and `muting_notifications` keys:

* `showing_reblogs` returns true if:
  1. You've requested to follow the user, with reblogs shown, or
  2. You are following the user, with reblogs shown.
* `muting_notifications` returns true if you have muted the user and
  their notifications as well.

* Rubocop fix

* Fix pulling reblog/mute status from relationships

I could swear this had passed tests before, but apparently not.
Works now.

* More test fixes

Really, you'd expect this to be more straightforward.
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 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants