diff --git a/src/extensibility/ExtensionManagerView.js b/src/extensibility/ExtensionManagerView.js index 43319dafcd..eb138e3436 100644 --- a/src/extensibility/ExtensionManagerView.js +++ b/src/extensibility/ExtensionManagerView.js @@ -20,6 +20,7 @@ */ /*unittests: ExtensionManager*/ +/*global Phoenix*/ define(function (require, exports, module) { @@ -500,6 +501,7 @@ define(function (require, exports, module) { */ ExtensionManagerView.prototype._installUsingDialog = function (id, _isUpdate) { var entry = this.model.extensions[id]; + const self = this; if (entry && entry.registryInfo) { const compatInfo = ExtensionManager.getCompatibilityInfo(entry.registryInfo, brackets.metadata.apiVersion), url = ExtensionManager.getExtensionURL(id, compatInfo.compatibleVersion), @@ -510,10 +512,26 @@ define(function (require, exports, module) { // TODO: this should set .done on the returned promise if (_isUpdate) { // save to metric id as it is from public extension store. - Metrics.countEvent(Metrics.EVENT_TYPE.EXTENSIONS, "install", id); - InstallExtensionDialog.updateUsingDialog(url).done(ExtensionManager.updateFromDownload); - } else { Metrics.countEvent(Metrics.EVENT_TYPE.EXTENSIONS, "update", id); + InstallExtensionDialog.updateUsingDialog(url).done((installResult)=>{ + if(Phoenix.browser.isTauri) { + // in tauri, due to browser cache for asset urls, updates to extensions will still load old + // extension through the http cache. So we show a restart app for the update to take effect + // message. + entry.installInfo.metadata = entry.registryInfo.metadata; + self.model._getEntry(id).updateAvailable = false; + // this is a hack as we will drop this extnsion manager and move to new one. so this will do. + self.model.trigger("change", id); + Dialogs.showModalDialog( + DefaultDialogs.DIALOG_ID_INFO, + Strings.EXTENSION_UPDATE_RESTART_TITLE, + Strings.EXTENSION_UPDATE_RESTART_MESSAGE + ); + } + ExtensionManager.updateFromDownload(installResult); + }); + } else { + Metrics.countEvent(Metrics.EVENT_TYPE.EXTENSIONS, "install", id); InstallExtensionDialog.installUsingDialog(url); } } diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 1f937c31cc..b1afad9d71 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -607,6 +607,8 @@ define({ // For NOT_FOUND_ERR, see generic strings above "EXTENSION_MANAGER_TITLE": "Extension Manager", "EXTENSION_MANAGER_ERROR_LOAD": "Unable to access the extension registry. Please try again later.", + "EXTENSION_UPDATE_RESTART_TITLE": "Restart To Update", + "EXTENSION_UPDATE_RESTART_MESSAGE": "To load updated extensions, please close all running instances of {APP_NAME} and restart the application.", "INSTALL_EXTENSION_DRAG": "Drag .zip here or", "INSTALL_EXTENSION_DROP": "Drop .zip to install", "INSTALL_EXTENSION_DROP_ERROR": "Install/Update aborted due to the following errors:",