Skip to content

When totalOnServer is zero and current page is 0 an infinite loop can happen #123

@sfanetti

Description

@sfanetti

in fixtable-grid.js

afterCurrentPageChanged: _ember['default'].observer('currentPage', function fixtableGrid$afterCurrentPageChanged() {
var currentPage = this.get('currentPage'),
totalPages = this.get('totalPages');
if (currentPage < 1) {
this.set('currentPage', 1);
} else if (currentPage > totalPages) {
this.set('currentPage', totalPages);
}
//Ember.run.once(this, this.notifyReloadContent);
_ember['default'].run.debounce(this, this.notifyReloadContent, 300, false);
})

console output:
https://apps.mypurecloud.com/s/#/1/cmmwvzrmorajho6xpqzzesrljm

If someone sets currentPage to zero while totalPages is zero the value of currentPage will be set to 1 and that will cycle this observer to then evaluate currentPage > totalPages to true - which then sets the value to 0 again. The loop reaches stack limit and blows up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions