app-center icon indicating copy to clipboard operation
app-center copied to clipboard

Snapd exception shown when connection timeout

Open tim-hm opened this issue 1 year ago โ€ข 12 comments

When trying to browse the app center without an internet connection this error was surfaced. We should fail more gracefully here.

@anasereijo @d-loose

SCR-20231101-spgu

tim-hm avatar Nov 01 '23 19:11 tim-hm

Hi @BLKKKBVSIK - I would like to pick up the issue and give it a try. Can you give me hint on where should I look for this issue? And how do I emulate it?

dishankjindal1 avatar Dec 10 '23 03:12 dishankjindal1

Hi @dishankjindal1

You simply have to run the project without being connected to internet. One good way to fix it, is to catch this error and display a generic text like "No connection or couldn't connect" Don't hesitate if you need more instructions.

BLKKKBVSIK avatar Dec 10 '23 10:12 BLKKKBVSIK

@BLKKKBVSIK After getting connection back, will users need to reload the app, or will it update automatically?

anasereijo avatar Dec 11 '23 11:12 anasereijo

For copy, I think it should read - We can't load content in the App Center without an internet connection.

One cool thing we could do is to use the animated icon as suggested here :)

Thanks for your help @dishankjindal1 !

anasereijo avatar Dec 11 '23 11:12 anasereijo

@BLKKKBVSIK After getting connection back, will users need to reload the app, or will it update automatically?

For now, the user will need to reload the tab at least. But in the case where the device has no internet connection, we could refresh it automatically in a second time.

BLKKKBVSIK avatar Dec 11 '23 11:12 BLKKKBVSIK

When offline, we could show a modal or screen to prevent users from interacting with the app. This avoids the complexities of handling numerous corner cases that arise when users navigate the app without an internet connection. The modal could include a 'retry' button and perform periodic connectivity checks, effectively freezing the app until internet is available.

A con of this approach is that some functionaltiy might be fine offline (eg uninstall). But I think to really 'solve' this we'd need to do a bigger piece of work thinking through what offline mode looks like and so I think the simpler approach for now is better.

tim-hm avatar Dec 13 '23 10:12 tim-hm

Could we have two solutions for two different scenarios?

a) user is using the app and then the internet disconnects:

I think we should show an error message within the page they had opened:

We can't load content in the App Center without an internet connection. Check your connection and reload. [Retry]

this way, once the connection is back, the user will see the page they were looking at before, or the page they were trying to open, so they don't lose the 'flow'.

b) user is offline and tries to open the app

have @tim-hm's approach of having a modal preventing users from interacting with the app. the window will be empty (dark or light depending on the user's theme)

Unable to connect to the App Center Check your connection and reload. [Retry]

some inspiration: Screenshot 2023-12-13 at 12 03 10

Screenshot 2023-12-13 at 12 03 25

anasereijo avatar Dec 13 '23 12:12 anasereijo

I recently ran into this issue where the device was online but on a network that didn't allow access to the snap store. It's an odd case, but the only place I saw the exception was the app details view. The more frustrating behavior was the discovery experience, trying to browse categories all listed the same apps. No indication it couldn't fetch the content from the store and even worse, once on a proper network the categories were still incorrect and the app data had to be purged to browse content. I guess it cached some incorrect data.

On Wed, Dec 13, 2023, 7:11 AM Ana Sereijo @.***> wrote:

Could we have two solutions for two different scenarios? a) user is using the app and then the internet disconnects:

I think we should show an error message within the page they had opened:

We can't load content in the App Center without an internet connection. Check your connection and reload. [Retry]

this way, once the connection is back, the user will see the page they were looking at before, or the page they were trying to open, so they don't lose the 'flow'. b) user is offline and tries to open the app

have @tim-hm https://github.com/tim-hm's approach of having a modal preventing users from interacting with the app. the window will be empty (dark or light depending on the user's theme)

Unable to connect to the App Center Check your connection and reload. [Retry]

some inspiration for the second use case: Screenshot.2023-12-13.at.12.03.25.png (view on web) https://github.com/ubuntu/app-center/assets/36884067/3ba16477-62b2-4031-93c2-14352bb9fb0c

โ€” Reply to this email directly, view it on GitHub https://github.com/ubuntu/app-center/issues/1479#issuecomment-1853803713, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAANMBPLGR6DAPGSNBDUO7TYJGLQBAVCNFSM6AAAAAA6ZZL7WSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJTHAYDGNZRGM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

kenvandine avatar Dec 13 '23 13:12 kenvandine

Hey, I am having trouble setting up the environment.

Can you give me detailed steps? Sorry, but i tried to do it myself and i need assistance now.

Currently i have macbook pro m2, and i installed UTM virtual machine and installed ubuntu 22LTS on it.

dishankjindal1 avatar Dec 13 '23 13:12 dishankjindal1

@dishankjindal1 have you tried the steps in contributing.md?

In the past I've found running these apps in an apple silicon VM tricky but hopefully the experience has improved :crossed_fingers:

tim-hm avatar Dec 13 '23 15:12 tim-hm

Could we have two solutions for two different scenarios?

@anasereijo maybe we pause until we've had time to think through the design for handling offline?

tim-hm avatar Dec 13 '23 17:12 tim-hm

@anasereijo maybe we pause until we've had time to think through the design for handling offline?

Agree, the whole offline experience needs more thinking, but I think that in the meantime it is important to tell the users what's going on somehow

anasereijo avatar Dec 13 '23 17:12 anasereijo