Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Service/SessionService.php5
-rw-r--r--src/components/EditorWrapper.vue4
-rw-r--r--src/services/PollingBackend.js2
3 files changed, 6 insertions, 5 deletions
diff --git a/lib/Service/SessionService.php b/lib/Service/SessionService.php
index 81251e9da..368b07ba0 100644
--- a/lib/Service/SessionService.php
+++ b/lib/Service/SessionService.php
@@ -70,7 +70,7 @@ class SessionService {
$session = new Session();
$session->setDocumentId($documentId);
$userName = $this->userId ? $this->userId : $guestName;
- $session->setUserId($userName);
+ $session->setUserId($this->userId);
$session->setToken($this->secureRandom->generate(64));
$color = $this->avatarManager->getGuestAvatar($userName)->avatarBackgroundColor($userName);
$color = sprintf("#%02x%02x%02x", $color->r, $color->g, $color->b);
@@ -124,9 +124,6 @@ class SessionService {
}
public function isValidSession($documentId, $sessionId, $token) {
- if ($this->userId) {
- return true;
- }
try {
$session = $this->getSession($documentId, $sessionId, $token);
} catch (DoesNotExistException $e) {
diff --git a/src/components/EditorWrapper.vue b/src/components/EditorWrapper.vue
index ab1daf877..5b68a390e 100644
--- a/src/components/EditorWrapper.vue
+++ b/src/components/EditorWrapper.vue
@@ -363,7 +363,9 @@ export default {
this.hasConnectionIssue = true
// FIXME: ideally we just try to reconnect in the service, so we don't loose steps
OC.Notification.showTemporary('Connection failed, reconnecting')
- setTimeout(this.reconnect.bind(this), 1000)
+ if (data.retry !== false) {
+ setTimeout(this.reconnect.bind(this), 5000)
+ }
}
if (error === ERROR_TYPE.SOURCE_NOT_FOUND) {
this.initialLoading = false
diff --git a/src/services/PollingBackend.js b/src/services/PollingBackend.js
index 8a4cc2b35..ad20f1857 100644
--- a/src/services/PollingBackend.js
+++ b/src/services/PollingBackend.js
@@ -159,6 +159,8 @@ class PollingBackend {
} else if (e.response.status === 403) {
this._authority.emit('error', ERROR_TYPE.CONNECTION_FAILED, {})
} else {
+ this.increaseRefetchTimer()
+ this._authority.emit('error', ERROR_TYPE.CONNECTION_FAILED, {retry: false})
console.error('Failed to fetch steps due to other reason', e)
}
})