Can GetAppAndOptionalStorePackageUpdatesAsync method be stuck?

BackNot 46 Reputation points
2021-06-28T13:19:49.867+00:00

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://learn.microsoft.com/en-us/windows/uwp/packaging/self-install-package-updates
https://learn.microsoft.com/en-us/uwp/api/windows.services.store.storecontext.getappandoptionalstorepackageupdatesasync?view=winrt-20348
https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpclient.getstringasync?view=net-5.0

Universal Windows Platform (UWP)
Microsoft Partner Center
Microsoft Partner Center
A Microsoft website for partners that provides access to product support, a partner community, and other partner services.
931 questions
0 comments No comments
{count} votes

Accepted answer
  1. Roy Li - MSFT 32,731 Reputation points Microsoft Vendor
    2021-06-29T02:41:15.403+00:00

    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.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful