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

Error: this collection cannot be loaded lazily #926

Open
tomkennedy22 opened this issue Jan 7, 2023 · 2 comments
Open

Error: this collection cannot be loaded lazily #926

tomkennedy22 opened this issue Jan 7, 2023 · 2 comments

Comments

@tomkennedy22
Copy link

Hey all, running in to a problem, would love some guidance.

I'm using the incremental indexeddb adapter created by @radex . I've had success with Vanilla Loki - as well as with the normal IndexedDB adapter, but really like the look of the Incremental Adapter.

I have about 20 collections, of varying sizes. All of them have the following settings:

  1. a proto define to inflate on load
  2. lazyLoad: true
  3. clone: true
  4. clone_method: shallow-assign
  5. The collection name is in the adapter options list for "lazyCollections".

I've tried this setup with all of the lazy settings turned off - both in individual collections and the adapter definition.

I'm at a bit of a loss on how to proceed. I've combed through all of the code that leads to that line, but can't figure out how to get my data loaded from idb for some of my collections. Notably, not all collections have this issue.

Thanks!

@radex
Copy link
Contributor

radex commented Jan 10, 2023

@tomkennedy22 I can't answer the problem off the top of my head, but my Loki usage is all here: https://github.com/Nozbe/WatermelonDB/blob/master/src/adapters/lokijs/worker/DatabaseDriver.js (and generally in the lokijs) catalog - maybe that helps you somehow in understanding how I use IncrementalIndexedDB

@tomkennedy22
Copy link
Author

Thanks for the response @radex. I've read through WatermelonDB, and I think it makes sense how you approach it. It might take me a few days/weeks to re-visit my code and figure out the gap, as I tabled the incremental-idb change for the time being.
Thanks for the help! I'll reach out again if needed.

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

2 participants