Skip to content

Commit 8fb0641

Browse files
authored
fix(DevSupportManager): Fix up-to-date bundle check (microsoft#1499)
Using `IStorageItem.GetBasicPropertiesAsync()` sometimes hangs. Instead using `System.IO.FileInfo`, which doesn't seem to hang (but is blocking). Since this is debug code, it's not a huge deal.
1 parent 49bfc69 commit 8fb0641

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ReactWindows/ReactNative.Shared/DevSupport/DevSupportManager.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,12 @@ public async Task<bool> HasUpToDateBundleInCacheAsync(CancellationToken token)
162162
#if WINDOWS_UWP
163163
var lastUpdateTime = Windows.ApplicationModel.Package.Current.InstalledDate;
164164
var localFolder = ApplicationData.Current.LocalFolder;
165-
var bundleItem = await localFolder.TryGetItemAsync(JSBundleFileName).AsTask(token);
165+
var bundleItem = await localFolder.TryGetItemAsync(JSBundleFileName);
166166
if (bundleItem != null)
167167
{
168-
var bundleProperties = await bundleItem.GetBasicPropertiesAsync().AsTask(token);
169-
return bundleProperties.DateModified > lastUpdateTime;
168+
// bundleItem.GetBasicPropertiesAsync() is occasionally hanging
169+
var fileInfo = new FileInfo(bundleItem.Path);
170+
return fileInfo.CreationTimeUtc > lastUpdateTime.UtcDateTime;
170171
}
171172
#else
172173
var lastUpdateTime = File.GetCreationTime(Assembly.GetExecutingAssembly().Location);

0 commit comments

Comments
 (0)