microsoft / AzureStorageExplorer

Easily manage the contents of your storage account with Azure Storage Explorer. Upload, download, and manage blobs, files, queues, tables, and Cosmos DB entities. Gain easy access to manage your virtual machine disks. Work with either Azure Resource Manager or classic storage accounts, plus manage and configure cross-origin resource sharing (CORS) rules.
Creative Commons Attribution 4.0 International
377 stars 87 forks source link

Selecting items then reloading throws an error #8318

Closed craxal closed 11 hours ago

craxal commented 1 day ago

For tables:

  1. Select any number of items.
  2. Click Refresh.

For queues:

  1. Select any number of items.
  2. Click Delete, then click OK.

In both cases, the same error occurs. It is thrown when attempting to map a nonempty selectedItemIndices array to items from an empty items array.

craxal commented 1 day ago

I suspect this is due to a state desyncing bug in the AsyncLoadingHook. A reload clears the selection array then requests a reload. The reload request clears out the internal data, which is where the empty items array is coming from. This is expected. However, the actual item clear probably happens on a different update cycle. The hook currently uses refs to store copies of items from the async data source. Changes to refs don't trigger a render, which may be why some things are off.

From what I can tell, the error is not surfaced to users, so it's not disruptive, and things correct themselves once the list of items is refreshed. Still something that makes me nervous, so we should look into this.