Commit 6ba34c77 authored by Luciano Pacheco's avatar Luciano Pacheco Committed by Commit Bot

Change directory tree to update all required metadata

Re-enables the call to |notifyEntriesChanged| and refresh all required
metadata which includes "share", "modificationTime" and "size" among
others.

The method |notifyEntriesChanged| invalidates all metadata, so we
should update all required metadata fields. This fixes the issue where
file list (RHS) wouldn't display modification time column, because
sometimes when it would try to display the metadata had been
invalidated due to the call to |notifyEntriesChanged|.

|notifyEntriesChanged|, so the fact that they're all passing now it's
the the actual test.

Test: Several tests were failing when re-enabling
Bug: 857343
Cq-Include-Trybots: luci.chromium.try:closure_compilation
Change-Id: I5a1e243c22c4040530c55d3d41708740dd617d88
Reviewed-on: https://chromium-review.googlesource.com/1117966Reviewed-by: default avatarDaichi Hirono <hirono@chromium.org>
Reviewed-by: default avatarSasha Morrissey <sashab@chromium.org>
Reviewed-by: default avatarLuciano Pacheco <lucmult@chromium.org>
Commit-Queue: Luciano Pacheco <lucmult@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577418}
parent c69f3014
......@@ -612,13 +612,12 @@ SubDirectoryItem.prototype = {
*/
SubDirectoryItem.prototype.updateSharedStatusIcon = function() {
var icon = this.querySelector('.icon');
// TODO(crbug.com/857343): Evaluate if this can be fully removed.
// This line invalidates the metadata model cache and was causing some
// directories to not display modificationTime which comes from metadata
// because it invalidated before displaying it.
// this.parentTree_.metadataModel.notifyEntriesChanged([this.dirEntry_]);
this.parentTree_.metadataModel.get([this.dirEntry_], ['shared']).then(
function(metadata) {
this.parentTree_.metadataModel.notifyEntriesChanged([this.dirEntry_]);
this.parentTree_.metadataModel
.get(
[this.dirEntry_],
constants.LIST_CONTAINER_METADATA_PREFETCH_PROPERTY_NAMES)
.then(function(metadata) {
icon.classList.toggle('shared', !!(metadata[0] && metadata[0].shared));
});
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment