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

LocalStore for web isn't working normally #4

Open
atrvicky opened this issue Apr 19, 2021 · 2 comments
Open

LocalStore for web isn't working normally #4

atrvicky opened this issue Apr 19, 2021 · 2 comments

Comments

@atrvicky
Copy link

I've been trying to implement localStore and it works normally on phones.
But when moving to the web, delete (code below) does not work properly.

// delete
final _db = Localstore.instance;
return await _db.collection(DOCUMENT_ID).doc(id).delete();

When I ran the code through debug mode, I landed on the following for the value against the key after I tried to delete.
<getObject: NoSuchMethodError: The getter 'uri' was called on null.>

But please be noted that the data is still being loaded & saved (the following code) normally.

// save
final _db = Localstore.instance;
return await _db.collection(DOCUMENT_ID).doc(id).set(toMap());
// load
final _db = Localstore.instance;
return await _db.collection(DOCUMENT_ID).get();

Am I missing something here? How could it list & save but not delete records?

One more thing that I noticed was, localStore is creating folders in the cache on phones and is not able to do the same on web. Is this the reason for this behavior? Or any suggestions where I might be handling it wrongly?

@chuyentt
Copy link
Owner

I've been trying to implement localStore and it works normally on phones.
But when moving to the web, delete (code below) does not work properly.

// delete
final _db = Localstore.instance;
return await _db.collection(DOCUMENT_ID).doc(id).delete();

When I ran the code through debug mode, I landed on the following for the value against the key after I tried to delete.
<getObject: NoSuchMethodError: The getter 'uri' was called on null.>

But please be noted that the data is still being loaded & saved (the following code) normally.

// save
final _db = Localstore.instance;
return await _db.collection(DOCUMENT_ID).doc(id).set(toMap());
// load
final _db = Localstore.instance;
return await _db.collection(DOCUMENT_ID).get();

Am I missing something here? How could it list & save but not delete records?

One more thing that I noticed was, localStore is creating folders in the cache on phones and is not able to do the same on web. Is this the reason for this behavior? Or any suggestions where I might be handling it wrongly?

Thanks! pls update package to 1.1.8

@Quethzel
Copy link

is this error still pending?

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

3 participants