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

PhStore: unified persistant storage in browser and tauri #1250

Merged
merged 13 commits into from
Dec 26, 2023
Merged

PhStore: unified persistant storage in browser and tauri #1250

merged 13 commits into from
Dec 26, 2023

Conversation

abose
Copy link
Member

@abose abose commented Dec 25, 2023

Localstorage and indexed db is not guarenteed to be persistant in desktop builds. Specifically, webkit will nuke the stored data in linux/mac tauri builds as part of ITP. We save a few of data into local storage like some preferences, so this will be a concern if a user comes back after some time and uses the app.

After this change, we now have a global PhStore object with the below API that can be used in all platforms. The storage layer is synchronous for get and put operations. This is not supposed to be used directly, but indirectly in phoenix via a future phoenix.getModule.

const PhStore = {
        getItem,
        setItem,
        flushDB,
        watchExternalChanges,
        unwatchExternalChanges,
        storageReadyPromise
    };

@phoenixide
Copy link
Member

Thank You for making this pull request.

@phoenixide
Copy link
Member

Thank You for making this pull request.

@phoenixide
Copy link
Member

Thank You for making this pull request.

@phoenixide
Copy link
Member

Thank You for making this pull request.

@phoenixide
Copy link
Member

Thank You for making this pull request.

@phoenixide
Copy link
Member

Thank You for making this pull request.

@phoenixide
Copy link
Member

Thank You for making this pull request.

Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

3 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@abose abose merged commit 5769cf8 into main Dec 26, 2023
17 checks passed
@abose abose deleted the store branch December 26, 2023 11:39
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

Successfully merging this pull request may close these issues.

2 participants