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

TableKit row having stale state in some cases when inserting/deleting and updating data at the same time #182

Closed
nataliq-pp opened this issue May 5, 2022 · 1 comment

Comments

@nataliq-pp
Copy link
Contributor

Expected Behavior

When the table data model of a TableKit instance is set to a new one where a row changed its item, the visible UI representation of the row should update accordingly.

Current Behavior

In some particular cases the row's UI won't be updated and would show an old value.

Steps to Reproduce

  1. Have a table with a few rows
  2. Set the table view height to match the content height
  3. Create a new table with an updated item for the last row and inserted new row before the last one
  4. Set the new table on the kit instance with "from top" insert animation

Result:
The table view would animate the change so that the last row stays visible, however it will show the old data.

Context

This is happening because we reconfigure and refresh only the rows for the visible index paths. However that's done right after applying changes to the table view with an animation which is synchronous but the effects on the visible index paths are delayed. So if we have 2 rows initially, insert one in the middle and update the last row, then right after the animate call the visible index paths will be 0 and 1 but after the animation completes the visible index paths will be 1 and 2 with the row on index 2 showing stale data.

  • Operating Version: -
  • Swift version: -

Failure Logs

@nataliq-pp
Copy link
Contributor Author

nataliq-pp commented May 9, 2022

Reproduced in this test.

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

1 participant