Closed waleed-alharthi closed 1 month ago
Could you plesse check if this sample is working fine or not on your system?
https://github.com/bitfoundation/bitplatform-samples/tree/develop/videos/Bit.Besql
The sample does work fine on my system.
It appears to be a newer Blazor web app (not WASM+ASP.Net Core hosted). Also, there's an "Offline-ClientDb.db" file showing up in the server?
In my setup I have Postgres in the server, SQLite in the client, and a semi-inherited db context to share the dbsets between the two.
The ClientData project is simply because I need a console app to add migrations to my WASM app.
There's a simple web assembly project working with index.html
https://github.com/bitfoundation/bitplatform/tree/develop/src/Butil
Could you plesse check that sample as well?
I can't get that sample to compile. Maui platforms mix-up and other errors popping up. Is there something I could be missing which causes the database to reset when I do a normal page refresh?
I'll check your project details soon. I that sample project, you can easily unload blazor maui hybrid project
I found this project on GitHub, uses Besql, purely WASM with no backend: https://github.com/ravi66/Book
It compiles and runs fine, the database persists between refreshes and completely separate runs! I'm trying to pin the differences in project config, index.html, dbcontext, program.cs, etc... can't find the culprit! 😔
One thing I've notice in the Book app is the cache has an actual entry for Besql:
My app:
It's very odd though. Because while my app is running, I can actually read and write to sqlite, I can navigate between SPA pages and see my data come back. However, I can't refresh or restart the app (all data gets lost).
It's hard to find the root cause in your issue, could you please send me a the most minimal possible sample project that reproduces the issue?
Apologies taking forever to respond. Is it alright if I share the actual project? It's an ongoing boilerplate project. It's self-contained in a docker-compose project runs with one click.
As far as we know, Bit.Besql
is working properly, so there's something different in your project.
We ask developers to create most simple sample that demonstrates the issue, because the time they're creating that simple sample, they found the root cause of the issue themselves!
We don't offer reviewing/test real world complex projects in our free community support to find the root cause on our own, but we do offer paid license that you can easily purchase by paying the specified amount in our GitHub sponsor page for at least one month for one developer. We not only check your project in a live meeting through desktop sharing to solve the issue, we'll improve the project's performance through project review, and you'll receive benefit on not only bitplatform related parts, but also aspnetcore, ef core and other technologies that you're using.
Let me know if you've any questions. Regards
That's fair. I'll keep trying and come around if there's no way out. Many thanks!
Is there an existing issue for this?
Describe the bug
[Dev Mode] When navigating between pages and returning to a page with populated data, it successfully retrieves data from Besql. However, when refreshing the page, all the data is gone.
For some context, I tried playing with the default service-worker.js just in case it's the culprit but without success.
Expected Behavior
Data to come back after page refresh.
Steps To Reproduce
Exceptions (if any)
No response
.NET Version
.Net 8.0.5
Anything else?
service-worker.js
Program.cs (I've had the issue from before adding BlazorJS.WebWorkers)
AppDbContext.cs