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

2.14.0: included relationship in JSONAPISerializer with additional links.related causes backtracking re-render #5023

Closed
buschtoens opened this issue Jun 20, 2017 · 9 comments · Fixed by #5119

Comments

@buschtoens
Copy link
Contributor

buschtoens commented Jun 20, 2017

Demo app here: https://github.com/buschtoens/ember-data-included-records-demo
Ember Data 2.13 works fine.

When a JSONAPI compliant server responds with included relationships, but also includes a links.related field, Ember crashes with a backtracking re-render error, if that relationship was accessed in a template.

{
  "data": {
    "type": "authors",
    "id": "1",
    "attributes": {
      "age": 20,
      "last-name": "Corkery",
      "first-name": "Joseph"
    },
    "relationships": {
      "blog-posts": {
        "data": [
          {
            "type": "blog-posts",
            "id": "1"
          },
          {
            "type": "blog-posts",
            "id": "2"
          }
        ],
        "links": {
          "related": "/show-stopper" // <=== this is the culprit
        }
      }
    }
  },
  "included": [
    {
      "type": "blog-posts",
      "id": "1",
      "attributes": {
        "text": "Enim et nihil. Nihil optio voluptas blanditiis. Officiis dignissimos consequatur eum. Et et eveniet sapiente voluptas soluta optio est.",
        "title": "aut odit voluptas"
      },
      "relationships": {
        "author": {
          "data": {
            "type": "authors",
            "id": "1"
          }
        }
      }
    },
    {
      "type": "blog-posts",
      "id": "2",
      "attributes": {
        "text": "Dolores ab consequatur exercitationem. Alias nisi quod sint animi iusto doloremque blanditiis. Enim accusantium animi et officia.",
        "title": "unde et aut"
      },
      "relationships": {
        "author": {
          "data": {
            "type": "authors",
            "id": "1"
          }
        }
      }
    }
  ]
}

A request to /show-stopper is never actually performed.

@buschtoens
Copy link
Contributor Author

buschtoens commented Jun 20, 2017

This was quite hard to track down. 🙁

Most likely #5017 is exactly this problem.

Possibly a duplicate of #4942. Please feel free to close this issue, if it in fact is.

@buschtoens buschtoens changed the title 2.14.0: included relationship in JSONAPISerializer with additional link.related causes backtracking re-render 2.14.0: included relationship in JSONAPISerializer with additional links.related causes backtracking re-render Jun 20, 2017
@tsteuwer
Copy link

We are having the same issue in all of our apps. We've had to go back to 2.13.1

@Charizard
Copy link

Same here!! Going back to 2.13

@rtablada
Copy link
Contributor

rtablada commented Jul 4, 2017

I also ran into this issue when the API returns links for a relation (included or not in my case).

@rtablada
Copy link
Contributor

rtablada commented Jul 4, 2017

This issue is happening in ember-data 2.14.0 through 2.14.3

@giano
Copy link

giano commented Jul 10, 2017

Same issue. 2.14.3. Rolling back to 2.13 branch (specifically 2.13.2) fixed this. This was driving me mad. Thank you for the hint.

@rstudner
Copy link

rstudner commented Aug 2, 2017

Any update on this? This essentially blocks upgrading to 2.14.x for many apps.

@ctcpip
Copy link
Contributor

ctcpip commented Aug 4, 2017

This issue should be closed. It's a duplicate of #4942

@mmun
Copy link
Member

mmun commented Aug 10, 2017

Hi @buschtoens. I tested my fix (#5119) against your example app and the data loads correctly. Thank you for creating this example app!

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 a pull request may close this issue.

8 participants