GithubHelp home page GithubHelp logo

Comments (14)

ggozad avatar ggozad commented on July 18, 2024

cc @demetris-manikas

from cordova-plugin-secure-storage.

demetris-manikas avatar demetris-manikas commented on July 18, 2024

Hi.
Look like there are invalid entries in the storage.
The only reason I can think that could cause such entries would be that an entry in localStorage whose name starts with SS and has not been created by the plugin.
@Darkoon could this be the case?
Can you please clarify whether the errors appeared after upgrading the plugin or the first time you tried it.
Also could you please debug and reply on which key the error happens and what's the value of it?

from cordova-plugin-secure-storage.

palucdev avatar palucdev commented on July 18, 2024

Hello again!
I'm not using localStorage in my project but decided to look at it, my localStorage is empty all the time.
Errors started to pop up from the very beginning and are connected with get method but they appear only once, after first use of get. I tried to test it on few devices and avd's but in all cases there were the same warnings/erros. Clearly I don't know what to do with that, plugin works fine and I really want to use it. Can you tell me something about the structure, where can I possibly find something to fix it? I'm using a few other cordova plugins (only one connected with data storage - sqlite plugin), maybe there are some conflicts between them?
Thanks for help!

from cordova-plugin-secure-storage.

ggozad avatar ggozad commented on July 18, 2024

This shouldn't stop you in anyway, we will have a look into it, but it should not affect the operation of the plugin.
In brief, we used to store encrypted data in localStorage but recently switched to using a native mechanism. There is a migration that happens the first time for those that had been using the old version. This migration fails in your case, but it shouldn't occur at all since it's a pristine installation and there is nothing to migrate.

from cordova-plugin-secure-storage.

palucdev avatar palucdev commented on July 18, 2024

Is there any other information I can provide to help fix this problem?

from cordova-plugin-secure-storage.

demetris-manikas avatar demetris-manikas commented on July 18, 2024

@Darkoon If you could provide the name and value of the failing entry it could point us to the right direction. If this is a problem for you I could instruct you on how to do it. Thanks.

from cordova-plugin-secure-storage.

palucdev avatar palucdev commented on July 18, 2024

I don't quiet understand about what entry are you talking (warnings/errors pop up for every key-value pair even for 'mykey', 'myvalue' from readme examples). So if you are talking about something else, please instruct me.

from cordova-plugin-secure-storage.

demetris-manikas avatar demetris-manikas commented on July 18, 2024

I am talking about debugging the plugin code. The error happens while migrating old data as ggozad already mentioned. Adding a printout of the key value pair that is being migrated in line 362 of securestorage.js would do the job. You can do the change either by forking this project or by changing the downloaded plugin code.

from cordova-plugin-secure-storage.

palucdev avatar palucdev commented on July 18, 2024

Sorry for the late response! Log added in line 362 was never called, so I decided to log key and value from line 385. I saw pairs generating warnings/errors, keys: insert, pushArrayand swapare all set to null.

from cordova-plugin-secure-storage.

jmotyl1959 avatar jmotyl1959 commented on July 18, 2024

Line 387 in www/securestorage.js does not check for a null value returned from JSON.parse and thus throws and exception. I modified that line to read:

if (payload != null && !payload.native) {

and it fixed the problem for me.

from cordova-plugin-secure-storage.

demetris-manikas avatar demetris-manikas commented on July 18, 2024

@jmotyl1959 Hey, thanks but you solve the problem by hiding the reason. Can you confirm Darkoon's findings?
@Darkoon thanks for your results I am looking into it.

from cordova-plugin-secure-storage.

demetris-manikas avatar demetris-manikas commented on July 18, 2024

@Darkoon @jmotyl1959 Can you please verify that applying the correction I did in my PR fixes the problem? My tests show it does but I 'll wait until you verify. Thanks for the help.

from cordova-plugin-secure-storage.

palucdev avatar palucdev commented on July 18, 2024

@demetris-manikas I can confirm that your correction fixed the problem for me.

from cordova-plugin-secure-storage.

ggozad avatar ggozad commented on July 18, 2024

Fixed in 2.5.2

from cordova-plugin-secure-storage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.