Skip to content

fix/crash test hardware deselected tree#1996

Merged
alanpeixinho merged 1 commit into
kernelci:mainfrom
profusion:fix/crash-test-hardware-deselected-tree
Jul 17, 2026
Merged

fix/crash test hardware deselected tree#1996
alanpeixinho merged 1 commit into
kernelci:mainfrom
profusion:fix/crash-test-hardware-deselected-tree

Conversation

@alanpeixinho

@alanpeixinho alanpeixinho commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

What it is

Fixes the crash where opening the log sheet of a boot whose tree was just deselected broke hardware details.

The log-sheet tables (BootsTable, BuildsTable, IndividualTestsTable) tracked the open log by row index. When a tree was deselected, the reloaded data dropped/reordered rows, so the stored index pointed past the list (sortedItems[currentLog].id → crash) or at the wrong item.

The tables now track the open log by the item's stable id and derive the row index from the live list each render. When the reloaded data no longer contains that id, the sheet closes on its own. This removes the fragile positional indexing entirely (crash impossible by construction) and also fixes the sheet reopening by itself when the tree was reselected.

How to test

  1. Open a hardware details page and select two trees, A and B, both with boots.
  2. Go to the Boots tab, deselect tree A, and quickly open the log sheet of a boot from A before B finishes loading.
  3. Expected: no crash. Once the filtered data reloads, the sheet closes automatically.
  4. Reselect tree A — the log sheet should stay closed (it must only open on an explicit click).
  5. Repeat on the Builds and Tests tabs to confirm consistent behavior.

Closes #1482

  * Use a proper id, instead of positional index to avoid accessing no
    longer valid build/boot/test.
  * Add an autoclose if a log is already opened for a build/boot/test
    that is from a deselected tree.

Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>

@felipebergamin felipebergamin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good. Tested locally, the fix works

@alanpeixinho
alanpeixinho added this pull request to the merge queue Jul 17, 2026
Merged via the queue into kernelci:main with commit 8078d3d Jul 17, 2026
7 checks passed
@alanpeixinho

Copy link
Copy Markdown
Contributor Author

Leaving small samples of the behaviour

crash fix
crash-deselect-tree fix-deselect-tree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Opening the log sheet of a desselected boot crashes hardware details

2 participants