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

Fix sync error "Index 332 out of bounds for length 332" #89

Open
yexingsha opened this issue Dec 6, 2023 · 2 comments
Open

Fix sync error "Index 332 out of bounds for length 332" #89

yexingsha opened this issue Dec 6, 2023 · 2 comments

Comments

@yexingsha
Copy link

In 1.0.16, I'm seeing "Finished sync (1 issue)" and getting this error message. I suspect there's something off, because before this update I have always been getting "Finished sync (5 issues)" and "Some data in My Library could not be downloaded. It may have been saved with a newer version of Zotero. Other data will continue to sync." Which is the same result as what I get on iOS.

@yexingsha
Copy link
Author

Also, on tablet (testing in Pixel C emulator), I'm getting "Finished sync (6 issues)", and "Unknown error".

tablet-allitems-error

Dima-Android added a commit that referenced this issue Dec 11, 2023
…calculation of deletion/insertion/modification positions for the table.

Fix sync error "Index 332 out of bounds for length 332" #89
Fixes the issue where if item were deleted remotely it was not removed from the table during partial sync.
Fixes the issue where if item were added remotely it was always added to the end of the table, instead of being inserted in it's correct position.

Since I now completely understand the All Items Screen business logic I decided to do a major refactoring related to generation of rows for this screen.  This led to a number of bugfixes listed above.

AllItemsProcessor class and is now responsible for all the work related to querying and listening to the database, processing the results and posting generated ItemCellModels to the ViewModel. Hence the ViewModel is much cleaner now.

ReadItemsDbRequest now doesn't return the actual result list, but instead an empty collection that is generated by Realm's findAsync method that is then being observed by AllItemsProcessor. It allows for much more straightforward and less duplicated code related to generation of ItemCellModels.
@yexingsha
Copy link
Author

Got the same error in emulator on first app launch, but it seems to go away after first sync. However, after a period of testing, the same error reappears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant