AzureStorageExplorer icon indicating copy to clipboard operation
AzureStorageExplorer copied to clipboard

Closing tabs causes shutdown

Open houlgap opened this issue 1 year ago • 6 comments

Preflight Checklist

Storage Explorer Version

1.36.0

Regression From

1.35

Architecture

x64

Storage Explorer Build Number

20241012.1

Platform

All

OS Version

Windows 11

Bug Description

Multiple regressions from the prior version having upgraded to version 1.36.

Formatting json files no longer works, it changes but then reverts back to unformatted json.

Closing tabs causes the shutdown of storage explorer even if other tabs still open (also impacted if last tab in split panel is closed)

Steps to Reproduce

  1. Launch storage explorer
  2. Open blob storage container
  3. Preview unformatted json file
  4. right-click select "Format JSON"
  5. Close just opened tab

Actual Experience

When selecting the "Format JSON" option, the formatted json is displayed for a brief moment, before reverting back to unformatted json. On closing the tab (that was opened in a separate panel), Storage explorer is closed, even though the other panel still has tabs.

Expected Experience

I would expect the formatted json to be displayed. I would not expect Storage Explorer to close until all tabs (whether in primary, or secondary panel) are closed.

Additional Context

No response

houlgap avatar Oct 16 '24 08:10 houlgap

Splitting this issue to track each separately (see #8250 for JSON formatting issue).

craxal avatar Oct 18 '24 20:10 craxal

@houlgap Can you elaborate on the shutdown part? Do you mean that the app quits entirely? Can you share your app logs with us?

craxal avatar Oct 18 '24 20:10 craxal

Is there a secure way to upload the logs? I have reviewed them but they don't seem to capture any errors.

Attached is a video of the re-pro. https://github.com/user-attachments/assets/29ba1b7f-4a58-4afe-a544-0d2e59c18914

houlgap avatar Oct 21 '24 15:10 houlgap

Here are the trace logs that were collected: StorageExplorerLogs.zip

houlgap avatar Oct 21 '24 17:10 houlgap

I am able to reproduce. Problem seems to have started after commit 2711461 when tab lifecycle was introduced. I've narrowed it down to where the panel tries to update the display name when formatting. The problem does not reproduce if the update request is omitted. So we need to figure out what about updating a panel is disrupting its lifecycle.

craxal avatar Oct 21 '24 18:10 craxal

We've discovered the problem. Code that sets up the <webview> element is run in the update method of a custom Knockout binding. Formatting JSON modifies the display name of the tab. Since the display name of the tab is an observable, the update method runs again, which means the setup code is run again, ultimately creating a new <webview> renderer process. This is why the JSON appears to reset almost immediately and why a crash happens when trying to close the tab.

This feels serious enough for a hotfix, so you should see a fix in 1.36.1 soon.

craxal avatar Oct 22 '24 17:10 craxal