threefoldtech / tfgrid-sdk-ts

Apache License 2.0
4 stars 8 forks source link

🐞 [Bug]: When the account doesn't have ssh in the metadata key, it crashes while loading the micro vm component (Maximum call stack size exceeded) #3023

Open AhmedHanafy725 opened 4 days ago

AhmedHanafy725 commented 4 days ago

Is there an existing issue for this?

which package/s did you face the problem with?

Dashboard

What happened?

When the account doesn't have ssh in the metadata key or (doesn't have the metadata key at all), it crashes while loading the micro vm component (Maximum call stack size exceeded)

Steps To Reproduce

which network/s did you face the problem on?

Dev

version

76de2278f0c335891d5a08626f4b5427270665a2

Twin ID/s

No response

Node ID/s

No response

Farm ID/s

No response

Contract ID/s

No response

Relevant screenshots/screen records

image

dashboard.log

Relevant log output

-
Mahmoud-Emad commented 4 days ago

That issue might be related to the reading of the SSH keys, but I believe it's solved at https://github.com/threefoldtech/tfgrid-sdk-ts/issues/2666.

Checking if there is something missing

Mahmoud-Emad commented 4 days ago

Issue update

Investigation and Solution:

What happened? we normally use a view-layout component to wrap all of our views. When creating a new view, the expected structure is:

<view-layout>
  ...
</view-layout>

Recently, someone added the component to the SSHKeys view. and this isn't wrong, we import the SSHKeys component within the view-layout component when there are no SSH keys. This setup creates a recursive component tree, leading to a maximum call stack size exceeded error.

we have two potential solutions:

  1. Display an Alert: Instead of importing the SSHKeys view within the view-layout, display the alert informing the user that SSH keys are required. and could provide a link to the SSH keys page for easy access.

  2. Use a Dialog: Create a small dialog component derived from the SSHKeys component to allow users to set their SSH key directly within the current context.

I agree with option 1 for now to make a patch release and can open an issue for option 2 if needed

Work done