daleharvey/pouchdb — pull request #1130 by ssured (2013-12-11 17:03:55+00:00)
Title: Allow passing of timeout option to the ajax call

Currently it is not possible to overrule the default ajax adapter timeout (10s)

My use case is a large attachment upload, uploaded using the inline format

This https://github.com/daleharvey/pouchdb/blob/master/lib/deps/ajax.js#L128 cancels the request after `options.timeout` milliseconds
This https://github.com/daleharvey/pouchdb/blob/master/lib/deps/ajax.js#L27 injects the default seconds, which implies that when no timeout is specified, the request is aborted after the default of 10s

The http adapter sets ajax options, but these are not depending on the supplied options, see https://github.com/daleharvey/pouchdb/blob/master/lib/adapters/http.js#L361 and https://github.com/daleharvey/pouchdb/blob/master/lib/adapters/http.js#L382.

#1129 does not solve this problem but will allow big uploads/downloads over thin but stable connections