question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ember 2.11 : getting infinite rendering when loading a model with relationships

See original GitHub issue

With Ember 2.11, when I load a relationships that have more than 10 elements, I get and “infinite rendering invalidation detected”.

This seems to come from adapters/firebase.js:142

  _fetch(ref, log) {
    this._incrementWaiters();
    return new Promise((resolve, reject) => {

      ref.once('value', (snapshot) => {
        this._decrementWaiters();
        Ember.run(null, resolve, snapshot);

      }, (err) => {
        this._decrementWaiters();
        Ember.run(null, reject, err);
      });

    }, log);
  },

replacing by :

  _fetch(ref, log) {
    this._incrementWaiters();
    return new Promise((resolve, reject) => {

      ref.once('value', (snapshot) => {
        this._decrementWaiters();
        Ember.run.scheduleOnce('afterRender', this, resolve, snapshot);

      }, (err) => {
        this._decrementWaiters();
        Ember.run.scheduleOnce('afterRender', this, reject, err);
      });

    }, log);
  },

works. I would guess it happens when we get a lot of update message at the same time, and they are called one after each other instead of being queued, anyway I will submit a pull request and you can see if you want to either fix the problem in firebase client or just fix it using ember.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jamesdanielscommented, Feb 3, 2017

2.0.6 has been cut 👍

0reactions
olivierchatrycommented, Feb 3, 2017

Thanks a bunch !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Infinite Loop in Ember-Data clearRelationships?
Stepping through the crash, the issue appears to be in clearRelationships, but no matter how minimal I attempt to make the Model relationships...
Read more >
Performance problems · Issue #12 · adopted-ember ... - GitHub
We really like ember-light-table but this performance issue is a show-stopper ... In some cases a load time of 20 seconds down to...
Read more >
Rendering a hasMany relation progressively - Ember.JS
My first try was to create a Component but I saw is not really a good pattern to load data from a Component...
Read more >
@ember-data/model | Yarn - Package Manager
Release 2.1.0 (October 5, 2015) · #3811 Format lists in JSONSerializer docs for rendering · #3814 [BUGFIX] Do not deserialize when a relationship...
Read more >
yoember.com: Ember.js Octane Tutorial - From beginner to ...
Free Ember.js tutorial for absolute beginners. ... using components; Lesson 6 - Advance model structures and data relationships ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found