podman-desktop icon indicating copy to clipboard operation
podman-desktop copied to clipboard

Podman onboarding redirects to wrong page

Open rostalan opened this issue 11 months ago • 2 comments

Bug description

After deleting a podman machine and going back to dashboard, podman onboarding appears, and after clicking Set up button, it redirects me to Settings page. I would expect it to either redirect me to onboarding or to redirect me to the Resources page in order to init and start a new machine? Or to not have the onboarding pop-up show up at all? Fixable only by restarting the app.

Operating system

Windows 10

Installation Method

Installer from website/GitHub releases

Version

1.8.0

Steps to reproduce

  1. Create podman machine
  2. delete it
  3. got to dashboard
  4. onboarding notification appears, click set up
  5. expected: onboarding page / resources page is shown
  6. actual: settings page is shown

Relevant log output

No response

Additional context

No response

rostalan avatar Mar 11 '24 16:03 rostalan

after the redirection to settings, if I try to go to the podman setup, Resources -> Setup Podman, the page is blank image

rostalan avatar Mar 11 '24 16:03 rostalan

similar to #5679

rostalan avatar Mar 11 '24 16:03 rostalan

After some investigation, the problem is related to the onboarding process being marked as successful and not being reset when the podman machine is deleted.

Let's decompose it

When we complete the first onboarding, we set a status equal to completed in the onboarding-registry for the podman extension OnboardingInfo.

image

When we click on Set up we are redirected to the page /preferences/onboarding/podman-desktop.podman which has some logic to fetch the on boarding infos.

It trigger the following startOnboarding

https://github.com/containers/podman-desktop/blob/0698e4d2fd1f3fcb64bfc8d66a96003545b6ee89/packages/renderer/src/lib/onboarding/Onboarding.svelte#L115-L123

But, since we already made a successful onboarding when we created our first podman machine, we still have the onboarding marked as completed therefore, the restartSetup is never called.

The entire component is wrap into a conditional block.

https://github.com/containers/podman-desktop/blob/0698e4d2fd1f3fcb64bfc8d66a96003545b6ee89/packages/renderer/src/lib/onboarding/Onboarding.svelte#L320

Since we never triggered the proper setup, as the onboarding is completed, we never defined a value for the active step. Leading to the empty page.

This also justify why restarting the application solve the issue, when we restart, we do not keep the completed status of the onboarding.

I do not see easy solution here. I am wondering if we could simply reset the onboarding status when specific events are triggered, like resource deletion.

Maybe the extension should be responsible of resetting the onboarding. But they seems to already be doing something that should be shown as updating the status.

https://github.com/containers/podman-desktop/blob/ced859363419bf61d1456d4aeb2c70812b4946a1/extensions/podman/src/extension.ts#L167

However, this does not trigger any changes in the status.

Solution proposal

We could trigger the reset of the onboarding when an extension update the context with scope onboarding, but I am afraid of spam, as for example podman is updating a lot the context with.

I made a quick POC, trying to fix it available here but a lot of new issue occurs https://github.com/axel7083/podman-desktop/tree/fix/podman-onboarding

cc @lstocchi @benoitf

axel7083 avatar Apr 08 '24 09:04 axel7083

I completely forgot this comment sorry. So by thinking quickly, 2 ideas. The first is, we could remove the if (!isOnboardingsSetupCompleted(onboardings)) { and just reset the onboarding everytime it gets started. The onboarding is now guided by the enablement, so it could be completed N times, not just once and this could not have any sense anymore. Maybe i'm missing something but i cannot think at any use case where this is useful🤔

The second is that we could show a page, like "the onboarding has already been run. Do you want to restart it?"

Let's wait for @benoitf 's comment

lstocchi avatar Apr 19 '24 16:04 lstocchi

I have to reopen this ticket since the issue is still reproducible in version 1.10.3 with the same steps as described in original post. See video below from latest PD release.

https://github.com/containers/podman-desktop/assets/106525396/0ceb8092-4fa7-416c-9a6a-f4b05f230847

cbr7 avatar May 28 '24 08:05 cbr7

Should be fixed in 1.11

jeffmaury avatar May 28 '24 13:05 jeffmaury

https://github.com/containers/podman-desktop/pull/7182 has not been backported to 1.10.X therefore is not included in 1.10.3.

ℹ️ I re-tested in the main branch, and can confirm this is fix.

Closing as this will be included in 1.11.X

axel7083 avatar May 28 '24 14:05 axel7083