Giter VIP home page Giter VIP logo

Comments (5)

dabch avatar dabch commented on June 16, 2024 1

That's a good idea, thanks! I didn't expect you to get active so quickly, appreciate that! :)

from tauri-settings.

harshkhandeparkar avatar harshkhandeparkar commented on June 16, 2024

Could you elaborate what you mean by two settings files?

from tauri-settings.

dabch avatar dabch commented on June 16, 2024

Sure. I have two instances of SettingsManager in different modules with different filenames (let's say settings-1.json and settings-2.json) being used in different modules of my (angular) app. They both get initialized at the same time. When the application is started for the first time (i.e. the settings folder doesn't exist yet) only one of the SettingsManagers is initialized successfullly and the other is unedfined (and the error above is shown).

From how I understood the code of this module, there seems to be a race condition in this try-catch block: ensure-settings-file.ts:29. Both instances of SettingsManager check if the folder exists, and then both try to create it. But only one can succeed of course.

I was going to try and fix this, but I haven't been able to get Typescript/Angular to accept my local copy of the module.

from tauri-settings.

harshkhandeparkar avatar harshkhandeparkar commented on June 16, 2024

From how I understood the code of this module, there seems to be a race condition in this try-catch block: ensure-settings-file.ts:29. Both instances of SettingsManager check if the folder exists, and then both try to create it. But only one can succeed of course.

Hmm, will have to investigate. As a temporary fix, perhaps you can initialize the second SettingsManager once the first one has been initialized using await or .then().

from tauri-settings.

harshkhandeparkar avatar harshkhandeparkar commented on June 16, 2024

Closing this.

from tauri-settings.

Related Issues (5)

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.