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
Fields with OfflineFirst() are not updated with the main document when fetching from the server #371
Comments
I started to review the package and found that indeed, although the parent document comes from FromRest, the association always obtains it from the local. So I had to modify the function. The adapter must also be modified so that the association sends the seedOnly parameter when obtained from FromRest offline_first_repository.dart
horse_adapter.dart REST
|
@hortigado Sorry, I'm unclear on the problem and the goal. This is how I'm interpreting both: Goal: (Defining instance: Problem: Is this the correct interpretation? If so, I'd be surprised if |
Hello @tshedor , the problem is that I don't speak English very well, which makes it difficult for me to explain. |
I was also thinking of another solution that the |
Your English is great, and I really respect you for writing complex code in a second language. I wanted to make sure we were on the same page before going on a tangent.
I agree that the policy should be passed on Let me write an integration test for this and see if passing the policy through has any side effects. |
Thank you, it is correct to pass the |
I like where you're going with this, but I worry that this becomes less granular. Setting the option before compile would mean that you couldn't change it during runtime, and you could only make one kind of query in your application code. I realize why I haven't done this sooner. I'd like to add something like the repository abstraction in the adapter method, but Future<Customer> _$CustomerFromSqlite(Map<String, dynamic> data,
{required SqliteProvider provider, OfflineFirstWithRestRepository? repository, covariant Policy?}) async { The other option would be to add it to The final option would be adding it as a stateful field on repository, set on every The easiest thing is to just add an optional parameter to @mateominato I know I'm dropping you into a long discussion but I'd appreciate your opinion on this problem. In short, the idea is to add a protected |
Hello again, I have run into a problem that I don't know if it is due to bad practice on my part. But when I request a document with
await remote
, the document obtains the latest from the server but itsOfflineFirst()
fields are not obtained from the server but from the local one.The text was updated successfully, but these errors were encountered: