From 89a56678e14e5421f77705826602d1da40c55242 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Fri, 10 May 2019 21:05:26 -0700 Subject: [PATCH] fix: use fibonacci instead of exponential when streaming (#1205) I dunno if this will improve #14, but it at least aligns us with Mastodon's behavior. --- src/routes/_api/TimelineStream.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/_api/TimelineStream.js b/src/routes/_api/TimelineStream.js index 69be738..2274ac8 100644 --- a/src/routes/_api/TimelineStream.js +++ b/src/routes/_api/TimelineStream.js @@ -71,7 +71,7 @@ export class TimelineStream { _setupWebSocket () { const url = getUrl(this._streamingApi, this._accessToken, this._timeline) - const ws = new WebSocketClient(url, null, { backoff: 'exponential' }) + const ws = new WebSocketClient(url, null, { backoff: 'fibonacci' }) ws.onopen = this._opts.onOpen || noop ws.onmessage = this._opts.onMessage ? e => this._opts.onMessage(JSON.parse(e.data)) : noop