From e6b11c37485fb6192beb885e4487c57be390e855 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 5 Mar 2021 16:01:20 +0100 Subject: [PATCH 1/7] Remove ID map in pad chat to save network and CPU usage --- www/common/outer/messenger.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/www/common/outer/messenger.js b/www/common/outer/messenger.js index b5aab9ca5..301218aa1 100644 --- a/www/common/outer/messenger.js +++ b/www/common/outer/messenger.js @@ -537,6 +537,15 @@ define([ if (peer === hk) { return; } if (channel.readOnly) { return; } + // XXX review + // Sending myData is used to build a "mapId" object which links + // netflux IDs to a curvePublic/uid. We use this map in friend chat + // to detect is the other user is online and we also use it in team chat + // to show if other team members are online (in the roster section). + // It is not needed in the pad chat for now and only causes useless + // network usage. + if (channel.isPadChat) { return; } + // Join event will be sent once we are able to ID this peer var myData = createData(proxy); delete myData.channel; From 3a91f7c06d19a8755fb88881d4b628b877ab40e7 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 8 Mar 2021 11:25:23 +0100 Subject: [PATCH 2/7] Fix team avatar --- www/common/outer/team.js | 1 + 1 file changed, 1 insertion(+) diff --git a/www/common/outer/team.js b/www/common/outer/team.js index f959ee11b..2634e483f 100644 --- a/www/common/outer/team.js +++ b/www/common/outer/team.js @@ -1046,6 +1046,7 @@ define([ if (!team) { return void cb ({error: 'ENOENT'}); } if (team.offline) { return void cb({error: 'OFFLINE'}); } if (!team.roster) { return void cb({error: 'NO_ROSTER'}); } + delete data.metadata.offline; team.roster.metadata(data.metadata, function (err) { if (err) { return void cb({error: err}); } var localTeam = ctx.store.proxy.teams[teamId]; From 942efcae07aa4c67d41c062df885aef8b2b5444a Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 8 Mar 2021 11:26:10 +0100 Subject: [PATCH 3/7] Fix type error --- www/common/outer/async-store.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index 091d9a6ad..5953194d3 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -2665,7 +2665,7 @@ define([ loadUniversal(Messenger, 'messenger', waitFor); store.messenger = store.modules['messenger']; loadUniversal(Profile, 'profile', waitFor); - store.modules['team'].onReady(waitFor); + if (store.modules['team']) { store.modules['team'].onReady(waitFor); } loadUniversal(History, 'history', waitFor); }).nThen(function () { var requestLogin = function () { From 543115b9938aad990cc601dfdc62a1b07ca5b178 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 5 Mar 2021 16:52:42 +0100 Subject: [PATCH 4/7] Force .md extensions to be recognized as markdown when uploading a file --- www/common/sframe-common-file.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/www/common/sframe-common-file.js b/www/common/sframe-common-file.js index bb700e7a6..fb432b5ad 100644 --- a/www/common/sframe-common-file.js +++ b/www/common/sframe-common-file.js @@ -428,6 +428,11 @@ define([ if (handleFileState.inProgress) { return void handleFileState.queue.push([file, e, defaultOptions]); } handleFileState.inProgress = true; + var type = file.type; + if (!file.type && /\.md$/.test(file.name)) { + type = "text/markdown"; + } + var thumb; var file_arraybuffer; var name = file.name; @@ -438,7 +443,7 @@ define([ if (!abort) { var metadata = { name: name, - type: file.type, + type: type, }; if (thumb) { metadata.thumbnail = thumb; } queue.push({ From 61b8830df4b5ec3d8eb6c4f5ddf9adfe2039109b Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 8 Mar 2021 12:04:02 +0100 Subject: [PATCH 5/7] Fix snapshots in sheets --- www/common/sframe-common-outer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index 7ecf9fa35..3d19b9a0a 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -1735,7 +1735,7 @@ define([ var cpNfCfg = { sframeChan: sframeChan, channel: secret.channel, - versionHash: parsed.hashData && parsed.hashData.versionHash, + versionHash: cfg.type !== 'oo' && parsed.hashData && parsed.hashData.versionHash, padRpc: Cryptpad.padRpc, validateKey: secret.keys.validateKey || undefined, isNewHash: isNewHash, From 8fc5647aea46e75dbbce7fd770c33ec7dde12bae Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 8 Mar 2021 12:07:46 +0100 Subject: [PATCH 6/7] Guard against possible type error --- www/common/outer/team.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/common/outer/team.js b/www/common/outer/team.js index 2634e483f..31785e26b 100644 --- a/www/common/outer/team.js +++ b/www/common/outer/team.js @@ -1046,7 +1046,7 @@ define([ if (!team) { return void cb ({error: 'ENOENT'}); } if (team.offline) { return void cb({error: 'OFFLINE'}); } if (!team.roster) { return void cb({error: 'NO_ROSTER'}); } - delete data.metadata.offline; + if (data.metadata) { delete data.metadata.offline; } team.roster.metadata(data.metadata, function (err) { if (err) { return void cb({error: err}); } var localTeam = ctx.store.proxy.teams[teamId]; From 5c688c8e774c143e0fb98f3b708eef018372e63d Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 8 Mar 2021 12:38:32 +0100 Subject: [PATCH 7/7] Update changelog and version --- CHANGELOG.md | 12 ++++++++++++ customize.dist/pages.js | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03beab596..81918d5dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +# 4.2.1 + +This minor release addresses a few bugs discovered after deploying 4.2.0: + +* The 4.2.0 release included major improvements to the sheet application. This introduced breaking changes to the "lock" system in the application. Existing spreadsheets (before 4.2.0) that were closed by a user without "unlocking" all cells first became impossible to open after the 4.2.0 changes. This has been fixed. +* Team owners can now properly upload a team avatar. +* We've improved the file upload script to better recognize markdown files. +* We've fixed a few issues resulting in an error screen: + * New users were unable to create a drive without registering first. + * Snapshots in the sheet application couldn't be loaded. + * Loading an existing drive as an unregistered user could fail. + # 4.2.0 (C) ## Goals diff --git a/customize.dist/pages.js b/customize.dist/pages.js index 708041915..3ea9606d6 100644 --- a/customize.dist/pages.js +++ b/customize.dist/pages.js @@ -62,7 +62,7 @@ define([ var imprintUrl = AppConfig.imprint && (typeof(AppConfig.imprint) === "boolean" ? '/imprint.html' : AppConfig.imprint); - Pages.versionString = "v4.2.0"; + Pages.versionString = "v4.2.1"; // used for the about menu Pages.imprintLink = AppConfig.imprint ? footLink(imprintUrl, 'imprint') : undefined;