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

Sync/update data between vuex and database #3604

Open
mittalyashu opened this issue Jan 23, 2020 · 0 comments
Open

Sync/update data between vuex and database #3604

mittalyashu opened this issue Jan 23, 2020 · 0 comments
Labels
discussion help wanted Extra attention is needed

Comments

@mittalyashu
Copy link
Member

mittalyashu commented Jan 23, 2020

The current approach we're following in this chore/add-nodegit branch is to update the database and then get the data from database and updating the whole repository array of objects.

With small database size it can work pretty efficiently but as the data grows inside the database, it can be different to maintain the performance of the application.

There're some unique scenarios with similar concepts:

Initialise repository

To improve the performance of the application we’re relaying in vuex, when the app mount for the first-time, required data is fetched from the database and saved inside vuex store.

directoryPath: "./code/gitthermal/thermal"
isGit: 1
repositoryId: 0
repositoryName: thermal

These are five data properties stored inside repository vuex store.

If a user adds a non-git repository, database register the data as isGit: 0 (means it is a non-git repository), and Thermal allows you to initialise git repository.

When the Init button is clicked the repository is initialise and database is updated for the same but it still shows to Init the repository because vuex store is still unaware of the changes made to database.

In order to fix the above, I create a bug fix for the same, but it still boils down to same thing.

You can see the source code for app mounting on first load.

Repository settings

We're not storing all the information inside the repository vuex store, except the important or data which is required at multiple places.

In this settings page the data is fetched from data with life-cycle mounted hook and stored inside local settings data property.

For updating/saving data back to database we're not storing the data inside vuex store instead directly hit the database by providing the required input data.

You can see the source code of repository/settings.vue.

I would like to hear your thoughts on how we can further improve this.

@mittalyashu mittalyashu added help wanted Extra attention is needed discussion labels Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant