Taitava / obsidian-shellcommands

Execute system commands via hotkeys or command palette in Obsidian (https://obsidian.md). Some automated events are also supported, and execution via URI links.
GNU General Public License v3.0
351 stars 11 forks source link

Console error related to HTMLButtonElement.tab_button_clicked #102

Closed Taitava closed 2 years ago

Taitava commented 2 years ago

This issue was reported by @FelipeRearden in 0.7.0 beta discussion. The problem only occurs on 0.7.0 beta versions (beta2, but probably on beta1 too), not on any versions available via the normal Obsidian plugin installation process.

Console Errors

I found this error when open the console after doing my tests. I only use SC in the session of testing :)

Screen Shot 2021-11-16 at 08 45 00

Taitava commented 2 years ago

I suspect that this is the offending line: https://github.com/Taitava/obsidian-shellcommands/blob/a6342f19146970ed66579923e2909e7fce29f83e/src/settings/setting_elements/Tabs.ts#L99 (The line accesses value property and is located in a function named tab_button_clicked, which matches with the console log message.)

But I do not know in which situation this bug happens. Probably after clicking a tab or icon, but what else is needed to trigger the bug...

Taitava commented 2 years ago

I can reproduce this bug. It happens in shell commands extra options modal. I need to click different tabs many times in a row, and sometimes a click does not activate a tab, but records an error to the console instead. The reason is still a mystery.

It did not seem to happen in the main settings view of the SC plugin, but I can't be certain.

Taitava commented 2 years ago

Mystery solved: I did a sustained firing of clicks and found a sweet spot: click an icon in a tab leaf and the bug occurs, because the application tries to access information from the clicked icon, not from the clicked tab leaf like it should. Happens both in the modal and in the main settings view.

FelipeRearden commented 2 years ago

Mystery solved: I did a sustained firing of clicks and found a sweet spot: click an icon in a tab leaf and the bug occurs, because the application tries to access information from the clicked icon, not from the clicked tab leaf like it should. Happens both in the modal and in the main settings view.

You are faster than me :)

I'm happy that you found the issue !!!!!!!

Taitava commented 2 years ago

Fixed with a super tiny change by commit 7e60f3706b7c7e0c7a99cd54d6cca75edd1cf21b.