Suggestions
Hi Dan!
I've been playing with this library and it's been really awesome. As I dive deeper into it's use, I've learned of a few gotchas that I was hoping could be discussed here:
Connectivity Handling
The dependency and logic using the CrossConnectivity plugin was unexpected. I typically handling this type of logic some place else so that I can properly decide what to do when there is no connection. One small example that caused confusion for me was SyncAsync returning when IsConnected is false. It fails silently and It was unclear what was happening. Another example is this bit of code. In my application, I want to have control of when a sync happens and this was also unexpected.
Is it really needed in this library? I suppose this might be something baked in to help reduce the logic someplace else.
PullAsync query support
It's desirable to provide a custom query to the PullAsync method for the sync table during a SyncAsync command. I am thinking it might be as easy as providing an overload to pass in a query. Thoughts?
Would it be best for me to fork this and make my customizations or is it something you might consider being part of this project? I'm not sure how generic this helper library is meant to be. Thanks for the great library!
Thanks for the feedback! I absolutely do accept PR's... though I generally suggest discussing the proposed changes in an issue prior to submitting the PR.
Connectivity
My original thinking was to use the Connectivity Plugin since it is a widely used library and it could potentially reduce the number of events you need to hook into. That said I'm happy to revisit this and honestly I think there's a ton of improvement in this area of the library.
Query Support
I'm pretty sure I added that already in a preview package.
My original thinking was to use the Connectivity Plugin since it is a widely used library and it could potentially reduce the number of events you need to hook into.
Sound reasonable. I still have to hook into these events for my application logic anyway and to make sure I do something intelligent. I still have to check for connectivity before doing any sync work. For example, I want to show some UI when there is no connection when a user tries to Sync. Maybe I am doing something silly though and working against the grain... What other improvements did you have in mind?
RE: Query Support I am using the latest pre so I don't think so. I also don't see it in master. I was expecting something in this area.
sorry I was thinking read items not pull... if I'm understanding what you want, you'd like the API to be more like:
Task PullAsync();
Task PullAsync(string query);
implemented like:
public Task PullAsync() => PullAsync($"incsync_{typeof(T).Name}");
public Task PullAsync(string query) => table.PullAsync(queryName, table.CreateQuery());
Is that right?
What other improvements did you have in mind?
Honestly I don't have anything specific in mind, but I have a feeling like it was an area that the library could probably offer more to developers.