Closed tute closed 10 years ago
It seems Job#deletion
is calling the second callback, reject
, which makes no sense to me.
Call comes from Queue#processNextJob
, job.perform()
is a rejected promise on successful HTTP DELETE.
It may be due to an empty body: https://github.com/rails/jquery-ujs/issues/337.
Indeed, ajax will trigger the error callback if DELETE
returns 200 with empty body. Following rails diff fixed the issue (changes response from 200
to 204 No Content
):
def destroy
@model.destroy
- render nothing: true
+ head :no_content
end
Ember Sync will rely on the adapters. If the adapter rejects, it'll reject as well. — Sent from Mailbox
On Mon, Jul 7, 2014 at 4:12 PM, Tute Costa notifications@github.com wrote:
Indeed, ajax will trigger the error callback if
DELETE
returns 200 with empty body. Following rails diff fixed the issue:def destroy @model.destroy - render nothing: true + head :no_content end
Reply to this email directly or view it on GitHub: https://github.com/kurko/ember-sync/issues/13#issuecomment-48226869
Thanks for your input. The issues I've been creating and that kind of architecture facts are good to add into the README, I smell a related PR coming.
Following code performs a
DELETE
HTTP request ad eternum:This is because upon successful (first)
DELETE
call the queue is not cleaned up, and the operations is retried every 5 seconds.