question

BackNot-4735 avatar image
0 Votes"
BackNot-4735 asked RoyLi-MSFT edited

Can GetAppAndOptionalStorePackageUpdatesAsync method be stuck?

I have code like this:

 IReadOnlyList<StorePackageUpdate> updates =
                 await storeContext.GetAppAndOptionalStorePackageUpdatesAsync();

After this invocation my application starts doing its stuff. Sometimes, when the store is down I think that this method is 'hanging' and it's waiting for a result that never comes. Is it possible? What is returned if the store is down? Is it null or exception is being thrown? I couldn't find anything in the docs or the forums.

For example - HttpClient.GetStringAsync() throws an exception if there is a network problem and the exception is listed in the documentation, but I can't find anything for this method.


Sources:
https://docs.microsoft.com/en-us/windows/uwp/packaging/self-install-package-updates
https://docs.microsoft.com/en-us/uwp/api/windows.services.store.storecontext.getappandoptionalstorepackageupdatesasync?view=winrt-20348
https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient.getstringasync?view=net-5.0

windows-uwppartner-center-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

RoyLi-MSFT avatar image
1 Vote"
RoyLi-MSFT answered

Hello,

Welcome to Microsoft Q&A!

Can GetAppAndOptionalStorePackageUpdatesAsync method be stuck?

Generally, the method will throw an exception if the server is down, unavailable or the server is having some unknown error. This method won't be stuck. I have to say that not all the exceptions will be listed on the document.

Thank you.


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.