Skip to content

Commit

Permalink
browser: show error msg when socket connection is closed unexpectedly
Browse files Browse the repository at this point in the history
Signed-off-by: Rash419 <[email protected]>
Change-Id: Ib654d0e81d0796ba379e9482ad90e6cb8af5901d
  • Loading branch information
Rash419 authored and timar committed Oct 25, 2023
1 parent 6a4cd7e commit 294c2da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions browser/src/core/Socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -1520,6 +1520,14 @@ app.definitions.Socket = L.Class.extend({

_onSocketClose: function () {
window.app.console.debug('_onSocketClose:');
if (!this._map._docLoadedOnce) {
var postMessageObj = {
success: false,
errorMsg: errorMessages.websocketconnectionfailed
};
this._map.fire('postMessage', {msgId: 'Action_Load_Resp', args: postMessageObj});
this._map.fire('error', {msg: errorMessages.websocketconnectionfailed, cmd: 'socket', kind: 'closed', id: 4});
}
if (this.ReconnectCount > 0)
return;

Expand Down
1 change: 1 addition & 0 deletions browser/src/errormessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ errorMessages.docloadtimeout = _('Failed to load the document. This document is
errorMessages.docunloadingretry = _('Cleaning up the document from the last session.');
errorMessages.docunloadinggiveup = _('We are in the process of cleaning up this document from the last session, please try again later.');
errorMessages.clusterconfiguration = _('Your %productName cluster appear to be mis-configured or scaling rapidly - please contact your system administrator. Continuing with editing may result in multiple users not seeing each other, conflicts in the document storage and/or copy/paste problems. Expected serverId %0 for routeToken %1 but connected to serverId %2');
errorMessages.websocketconnectionfailed = _('Failed to establish socket connection or socket connection closed unexpectedly. The reverse proxy is probably misconfigured, please contact the administrator. For more info on proxy conifguration please checkout https://sdk.collaboraonline.com/docs/installation/Proxy_settings.html');
if (window.ThisIsAMobileApp) {
errorMessages.storage = {
loadfailed: _('Failed to load document.'),
Expand Down

0 comments on commit 294c2da

Please sign in to comment.