PolymerElements / app-storage

Data-pipes and specialized services
61 stars 47 forks source link

Error to connect to IndexDB in Android device #49

Closed abdonrd closed 5 years ago

abdonrd commented 8 years ago

Description

With this simple code:

screen shot 2016-05-31 at 17 31 36

In desktop everything works, but in Android device (remote debugging in Nexus 5X) I have this error to connect to IndexDB:

screen shot 2016-05-31 at 17 15 20
BorntraegerMarc commented 7 years ago

I think the problem arises if you build the project with polymer build

BorntraegerMarc commented 7 years ago

Found the solution. I added:

    "bower_components/app-storage/app-indexeddb-mirror/app-indexeddb-mirror-worker.js",
    "bower_components/app-storage/app-indexeddb-mirror/common-worker-scope.js"

To polymer.json. From the polymer starter kit

BorntraegerMarc commented 7 years ago

However when I run the demo then my persistedData never takes the values from indexdb. I put in manually some values in there but persistedData is not updated. @abdonrd you ever had that issue?

abdonrd commented 7 years ago

I think is the same issue: https://github.com/Polymer/polymer-build/issues/22

BorntraegerMarc commented 7 years ago

@abdonrd but it worked for me with adding it to the polymer.json... and doesn't explain that persistedData does not updated, right?

abdonrd commented 7 years ago

When I tried this, didn't work: https://github.com/Polymer/polymer-build/issues/22#issuecomment-248537950

BorntraegerMarc commented 7 years ago

jep, saw that thanks @abdonrd :) but I was more asking about the general usage (because documentation is veeery limited for this element). So persistedData actually never got updated. Also not if I served it over polymer serve alone. Did it ever work for you?

abdonrd commented 7 years ago

Yes, with polymer serve it works for me:

screen shot 2017-04-04 at 12 36 14 pm
BorntraegerMarc commented 7 years ago

@abdonrd Could you help me out real quick? I only get the persistedData if the normal data (or liveData) has been set/updated: image

I included it:

<app-indexeddb-mirror
                    id="appindexdb"
                    key="cats" log
                    data="{{liveData}}"
                    persisted-data="{{persistedData}}">
</app-indexeddb-mirror>

But I never set liveData to a value. It's undefined. I expect that the app-indexeddb-mirror element would load persistedData automatically from the mirrored_data DB: image

Is that not the case? Because that value is already stored.

abdonrd commented 7 years ago

@BorntraegerMarc try to isolate the problem in a pastebin and I'll check it out.

hyyan commented 6 years ago

@abdonrd This issue is one year old and still no solution?

abdonrd commented 6 years ago

@hyyan I'm sorry, but I have not tried again about this.

abdonrd commented 5 years ago

As far as I know, the Polymer Elements are not going to continue developing. So I close this issue.