GithubHelp home page GithubHelp logo

Comments (18)

xie392 avatar xie392 commented on June 2, 2024

I also encountered the same problem.And why the data I saved cannot be accessed after refreshing? It should be because there is no persistent storage in it.My storage method is as follows:
image

from sqlite.

jepiqueau avatar jepiqueau commented on June 2, 2024

@xie392 i do not think it is the same issue. This is a refresh problem with typeOrm when you use jeep-sqlite you must set the autosave property to false meaning that you must save the database to store yourself. the problen when you do a refresh the database has not been save to store. for this if the platform is web you have to create a refreshListener which close the connection meaning that the database is save to store in the close connection process. something like

const refreshListener = window.addEventListener('beforeunload', async () => {
  here you close the connection
}

do not forget to remove the refresh listener when you leave the page

            window.removeEventListener('beforeunload', refreshListener);

from sqlite.

jepiqueau avatar jepiqueau commented on June 2, 2024

@Sadi-1992 can you share your app

from sqlite.

xie392 avatar xie392 commented on June 2, 2024

@xie392我不认为这是同一个问题。这是 typeOrm 的刷新问题,当您使用 jeep-sqlite 时,您必须将 autosave 属性设置为 false,这意味着您必须保存数据库来存储自己。刷新数据库时出现的问题尚未保存到存储中。为此,如果平台是网络,则必须创建一个刷新监听器来关闭连接,这意味着数据库将保存在关闭连接过程中。就像是

const refreshListener = window.addEventListener('beforeunload', async () => {
  here you close the connection
}

离开页面时不要忘记删除刷新侦听器

            window.removeEventListener('beforeunload', refreshListener);

address.I don't know if what I'm doing is correct.can you take a look at it for me.

from sqlite.

jepiqueau avatar jepiqueau commented on June 2, 2024

@Sadi-1992 use Chrome or Edge Developer Tools to inspect the Space-Usage. how do you inspect the Space-Usage ? Please tell me how to proceed

from sqlite.

jepiqueau avatar jepiqueau commented on June 2, 2024

@Sadi-1992 What is the size of your database?

from sqlite.

Sadi-1992 avatar Sadi-1992 commented on June 2, 2024

@jepiqueau Hi Mate, thanks for the reply! 👍

@Sadi-1992 use Chrome or Edge Developer Tools to inspect the Space-Usage. how do you inspect the Space-Usage ? Please tell me how to proceed

You can open developer tools in chrome with "ctrl + shift + i". Then go to "Application" and select "Storage" on the left side. There you can see the used storage of the whole application.

@Sadi-1992 What is the size of your database?

Its not necessary how big the database is to trigger the issue. In my case i only create four tables and fill in a first row inside one of them. After that, the usage of the storage is growing each time i trigger "saveToStore" even if i don't add any new data.

@Sadi-1992 can you share your app

unfotunately i can't share the app since its from my company. I could try to create an example if really needed.

from sqlite.

jepiqueau avatar jepiqueau commented on June 2, 2024

@Sadi-1992 i so this it sometimes increasing or decreasing when you refresh. I control at the jeepSqliteStore the size of the databases created under databases store object and here the the behaviour is correct.

from sqlite.

jepiqueau avatar jepiqueau commented on June 2, 2024

@Sadi-1992 if you close the browser and restart the app the size of the store decreasing to the normal size. It is probably a refresh of the indexedDB which is not correctly done in that command giving the graph of the storage

from sqlite.

jepiqueau avatar jepiqueau commented on June 2, 2024

@Sadi-1992 i update jeep-sqlite by adding a Test Memory Leak in the Tests Menu. Before starting the test i delete jeepSqliteStore in the localhost:3333 and i run the component in the Home page few databases (9) are created if you look at the Chrome Development Tools Storage you get 2.4MB shows in the graph. if you go inside the store databases in jeepSqliteStore you will see at the item 3 the key dbForCopySQLite.db with a value having a a byte length of 28672 now run the Test Memory Leak it is going to insert 2 times a set of 1000 names in the areas table you will see this in the console
2023-04-24-Log_Test_Memory_Leak.log
if you look at the storage in the Chrome Development Tools you will see 2.5MB and if you look at the application and refresh the jeepSqliteStore you will see that the dbForCopySQLite.db as a length of 315392 which is correct. Now if you refresh Test Memory Leak page you will see the storage value increasing to 2.6MB. So for me there is no issue

from sqlite.

jepiqueau avatar jepiqueau commented on June 2, 2024

@Sadi-1992 you must use [email protected] for this above

from sqlite.

jepiqueau avatar jepiqueau commented on June 2, 2024

@xie392 i fork it but i cannot run pnpm i i got this type of message ``` WARN  GET https://registry.npmjs.org/@testing-library%2Fdom error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/@testing-library%2Fjest-dom error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/@testing-library%2Freact error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/@testing-library%2Fuser-event error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.

from sqlite.

xie392 avatar xie392 commented on June 2, 2024

@xie392 i fork it but i cannot run pnpm i i got this type of message ``` WARN  GET https://registry.npmjs.org/@testing-library%2Fdom error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/@testing-library%2Fjest-dom error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/@testing-library%2Freact error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/@testing-library%2Fuser-event error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.

I have an instance running right now, I'm not sure when I'm going to shut it down, if you have some time now you can take a look. address .This is my workspace

from sqlite.

jepiqueau avatar jepiqueau commented on June 2, 2024

@xie392 i got it working by going down to capacitor5 but what is your question? i got the home page when i go to user i cannot add a user or get the list of users

from sqlite.

xie392 avatar xie392 commented on June 2, 2024

@xie392 i got it working by going down to capacitor5 but what is your question? i got the home page when i go to user i cannot add a user or get the list of users
After refreshing, search for the data just added, but cannot find it.

from sqlite.

xie392 avatar xie392 commented on June 2, 2024

@xie392 i got it working by going down to capacitor5 but what is your question? i got the home page when i go to user i cannot add a user or get the list of users
After refreshing, search for the data just added, but cannot find it.

image
image
Also, in a database that has no tables at the beginning, do I have to enable this every time? Is this correct?
image

from sqlite.

jepiqueau avatar jepiqueau commented on June 2, 2024

@Sadi-1992 Have you time to have a look and test?

from sqlite.

jepiqueau avatar jepiqueau commented on June 2, 2024

@Sadi-1992 As i do not get feedback and i demonstrate that there is no issue i close it

from sqlite.

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.