-
Notifications
You must be signed in to change notification settings - Fork 32
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
send parents first and update foreign keys with sendAll #95
Conversation
8c41e2a
to
1cd9e4a
Compare
1cd9e4a
to
dcf5690
Compare
This should fix #94 |
41b6a1e
to
f834422
Compare
Ok, I finally had a chance to look at this. I started by implementing a test case which appears to be working (see #94), other than an issue that came up while testing (#102). So, my first suggestion would be to extend the test case and see if you can get it to fail. Even if it is working, there is certainly room for improvement in how this is implemented. There are two main considerations here, which we can address individually.
|
I think that it's good to keep in mind that developing the batch service would be the next step, and it can be done in different ways too. Besides improving performance, especially in comparison to my request-by-request way in rural areas (it takes literally hours), and also solving #102, it could enable (even circular) dependencies between items. When no attachments are synced, probably one big request would be ideal, but in case of bigger attachments the app would need to revert to the old behaviour, so sync order or hierarchical sync still need to be implemented. I though about writing a test to ensure that any implementation doesn't attempt sending dependent records after the parent failed. But in the real project I need to track these locked records too, and currently I am able to dig the web server logs to recover them. Batch service wouldn't break this. |
A new function calculates the proper sync order for models. It is used in
outbox.sendAll
.