Browse Source

tus: docs-deprecate autoRetry (#2347)

* tus: deprecate autoRetry

`autoRetry` retries failed uploads when the user's internet connection
comes back up after an outage. It's not totally clear from the name that
that is what it does: it could also just retry automatically after a
failure generally.

This feature can be implemented by users like this:
```js
uppy.on('back-online', () => {
  uppy.retryAll()
})
```
I think that's clearer than `autoRetry: true`, and we don't even have
to come up with a name!

Since the implementation is trivial and the functionality is independent
of tus, it probably shouldn't live in the plugin. Users can copy the
three lines from the docs and use it that way. We could also consider
moving it into `@uppy/core`.

* tus: fill in pr url

* tus: revert runtime deprecation

* changelog: remove deprecated `autoRetry` in 2.0
Renée Kooi 4 years ago
parent
commit
2fdf880064
2 changed files with 9 additions and 1 deletions
  1. 1 0
      CHANGELOG.md
  2. 8 1
      website/src/docs/tus.md

+ 1 - 0
CHANGELOG.md

@@ -72,6 +72,7 @@ PRs are welcome! Please do open an issue to discuss first if it's a big feature,
 - [ ] companion: add more reliable tests to catch edge cases in companion. For example testing that oauth works for multiple companion instances that use a master Oauth domain.
 - [ ] transloadit: remove `UPPY_SERVER` constant
 - [ ] providers: allow changing provider name title through locale? https://github.com/transloadit/uppy/issues/2279
+- [ ] tus: remove `autoRetry` option (throw error at runtime if it is explicitly given)
 
 ## 1.23
 

+ 8 - 1
website/src/docs/tus.md

@@ -16,7 +16,6 @@ const Tus = require('@uppy/tus')
 uppy.use(Tus, {
   endpoint: 'https://master.tus.io/files/', // use your tus endpoint here
   resume: true,
-  autoRetry: true,
   retryDelays: [0, 1000, 3000, 5000]
 })
 ```
@@ -91,6 +90,14 @@ Pass an array of field names to limit the metadata fields that will be added to
 
 ### `autoRetry: true`
 
+> This option may be removed in Uppy 2.0. Consider implementing the feature manually:
+>
+> ```js
+> uppy.on('back-online', () => {
+>   uppy.retryAll()
+> })
+> ```
+
 Configures whether or not to auto-retry the upload when the user's internet connection is back online after an outage.
 
 Note that this is unrelated to the `retryDelays` option. The `retryDelays` option specifies how often to retry an upload that failed. The `autoRetry` option attempts to retry uploads that failed in the past, once the network has changed.