Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FSunstone] Safely handle row selection #6507

Closed
3 tasks
vichansson opened this issue Feb 20, 2024 · 0 comments · Fixed by OpenNebula/docs#2850 or OpenNebula/docs#2851
Closed
3 tasks

[FSunstone] Safely handle row selection #6507

vichansson opened this issue Feb 20, 2024 · 0 comments · Fixed by OpenNebula/docs#2850 or OpenNebula/docs#2851

Comments

@vichansson
Copy link
Contributor

vichansson commented Feb 20, 2024

Description

Any container utilizing the EnhancedTable component needs to gracefully handle the selection of rows to avoid calling toggleRowSelected on a seemingly undefined row, causing a react crash.

To Reproduce
Can be reproduced in several ways, simplest ones being:

First method

  1. Open the Storage/Apps tab, displaying the marketplace apps

image

  1. Select any app

image

  1. Use the search bar to filter the table output, hold CTRL and select another app, you should now have two apps selected and the details view should confirm this.
    image

  2. Try deselecting the FIRST app, AKA the one you selected in the first step, by pressing the little circled X button in the tag

This will result in a react crash:

TypeError
row is undefined
Call Stack
 handleRowById
  bundle.sunstone.js:262311:13
 reducer$8
  bundle.sunstone.js:262326:20
./node_modules/react-table/dist/react-table.development.js/
  bundle.sunstone.js:259741:16
./node_modules/react-table/dist/react-table.development.js/
  bundle.sunstone.js:259740:126
 updateReducer
  bundle.sunstone.js:229540:22
 useReducer
  bundle.sunstone.js:230647:16
 useReducer
  bundle.sunstone.js:268016:21
 useTable
  bundle.sunstone.js:259745:35
 EnhancedTable
  clientbundle.src_client_components_Tables_index_js.js:7117:78
 renderWithHooks
  bundle.sunstone.js:229207:27

Second method

  1. Go to the Instances/VMs tab, displaying the VMs

image

  1. Select a VM, state does not matter

image

  1. Delete the VM

image

  1. The deleted VM is still being displayed in the details tab/container, even though it no longer exists. So from the tables perspective, it is still selected.

image

  1. Press the button in the corner of the detailed view, attempting to close it

image

This will result in a react crash, same way as in the first method.

TypeError
row is undefined
Call Stack
 handleRowById
  bundle.sunstone.js:262311:13
 reducer$8
  bundle.sunstone.js:262326:20
./node_modules/react-table/dist/react-table.development.js/
  bundle.sunstone.js:259741:16
./node_modules/react-table/dist/react-table.development.js/
  bundle.sunstone.js:259740:126
 updateReducer
  bundle.sunstone.js:229540:22
 useReducer
  bundle.sunstone.js:230647:16
 useReducer
  bundle.sunstone.js:268016:21
 useTable
  bundle.sunstone.js:259745:35
 EnhancedTable
  clientbundle.src_client_components_Tables_index_js.js:7117:78
 renderWithHooks
  bundle.sunstone.js:229207:27

Additional Context
It does not affect every single component that utilizes the EnhancedTable. For example, for the VM Templates, this is not the case. When a VM Template is deleted, the row is automatically de-referenced (and detailed view closes).

Expected behavior
The selected row toggle should always be able to deselect rows, no matter the context.

Details

  • Affected Component: [FireEdge]
  • Version: [Development] - Most likely affects other versions too.

Progress Status

  • Code committed
  • Testing - QA
  • Documentation (Release notes - resolved issues, compatibility, known issues)
@vichansson vichansson self-assigned this Feb 20, 2024
@tinova tinova added this to the Release 6.8.3 milestone Feb 20, 2024
@tinova tinova closed this as completed Feb 20, 2024
@tinova tinova reopened this Feb 20, 2024
@tinova tinova modified the milestones: Release 6.8.3, Release 6.8.2 Feb 20, 2024
vichansson added a commit to OpenNebula/docs that referenced this issue Feb 21, 2024
Signed-off-by: Victor Hansson <vhansson@opennebula.io>
vichansson added a commit to OpenNebula/docs that referenced this issue Feb 21, 2024
Signed-off-by: Victor Hansson <vhansson@opennebula.io>
tinova pushed a commit to OpenNebula/docs that referenced this issue Feb 21, 2024
Signed-off-by: Victor Hansson <vhansson@opennebula.io>
tinova pushed a commit to OpenNebula/docs that referenced this issue Feb 21, 2024
Signed-off-by: Victor Hansson <vhansson@opennebula.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment