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

Ember 3.16 update breaking when table.setRows is called immediately after creating the table #744

Open
pragatheeswarans opened this issue Jun 11, 2020 · 3 comments

Comments

@pragatheeswarans
Copy link

We were updating our application to Ember 3.16 from 3.12 and found the following error thrown when the table is rendered initially. The error message is as follows.

Error: Assertion Failed: You attempted to update `[]` on `[object Object],
[object Object],[object Object]`, but it had already been used previously in the
same computation.  Attempting to update a value after using it in a computation 
can cause logical errors, infinite revalidation bugs, and performance issues, 
and is not supported.

`[]` was first used:

- While rendering:
  ----------------
    this.data

The error is thrown when i try to create a table by passing the model and then when i try to sort the table by our custom sort function and calling table.setRows(sortedModel).

const { sortField, model, columns } = this;
const sortedModel = model.sortBy(sortField);
const table = Table.create({ columns, rows: model, enableSync: true });
const sortColumn = table.get('allColumns').findBy('valuePath', sortField);    
sortColumn.setProperties({
  sorted: true,
  ascending: true
});
table.setRows(sortedModel); // This causes the issue
return table;

This was working fine until Ember 3.12. I have created a twiddle to reproduce the issue with minimal code possible. I think this might be similar to the issue reported in ember-table addon

Thanks

@Gorzas
Copy link
Contributor

Gorzas commented Nov 12, 2020

Do you still have this problem? Which version of ember-light-table are you using?

@RobbieTheWagner
Copy link
Member

@pragatheeswarans we have made a lot of updates to the master branch. Can you please see if this is still an issue?

@vladern
Copy link

vladern commented Oct 17, 2022

On version 3.0.0-beta.1 is still an issue :/

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

No branches or pull requests

4 participants