This repository has been archived by the owner on Aug 2, 2024. It is now read-only.
Replies: 1 comment 2 replies
-
Using .Wait() and .Result is a code smell that says you are not using async/await properly and likely bumping into dead locks. Switch over to async/await and see if it solves the problem. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We are using datasync client in a small Azure Portal web service to integrate to our SQL Server database. On the client side, we are using .NET Maui and Datasync.Client.SQLiteStore. For the most part, things are working as expected. If I create the client and then simply pull the remote table, as in this example, it works 100% of the time:
Now the problems begin when using offline tables. Most of our tables work fine but some of them work some of the time and others never work. When I say they "don't work", I mean they're getting stuck indefinitely, despite the client having a timeout set for 30 seconds.
Here is an example:
This example doesn't use any kind of filter and just pulls all records. I originally had a filter but, removed it thinking that was part of the problem. The line above can be sometable.PullItemsAsync(sometable.Where(x => x.something == something)).Wait();
We have several tables that get stuck on PullItemsAsync(). Now, in this example, I'm waiting for an async call to finish. Normally you wouldn't do this but for simplicity, in this test, I'm just waiting for the response. In reality, I do not block the UI thread as I do calls like this in another thread in the background. SomeTable has the same boiler plate columns that all of our tables have (Id [PK], Version, CreatedAt, UpdatedAt and Deleted) and it had three additional columns (a string and two booleans). At first I started deleting records one-by-one to see if bad data was causing the issue. It continued to get stuck on the pull even when it was down to zero records. So then I started to remove the custom columns one-by-one and to my surprise, I got down to just the standard columns listed above, and it still got stuck. What doesn't make sense is we have other tables that use those same columns and they work. Next, I updated datasync client from 6.0.6 to 6.1 and also the sqlitestore to 6.1 in the app itself. Again, it made no difference. Azure Portal is displaying no errors. Please help!
Thank you so much in advance!
Beta Was this translation helpful? Give feedback.
All reactions