bug: main kugetsu script has duplicate buggy update_queue_item_state #170
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The main kugetsu script (kugetsu) sources kugetsu-index.sh which defines the FIXED update_queue_item_state(). However, kugetsu LATER defines its OWN update_queue_item_state() function which OVERWRITES the fixed one.
This happens because kugetsu sources modules in order, then later in the same file defines its own version of the function.
Impact
When check_task_timeouts() in kugetsu calls update_queue_item_state to set error state, the os.system() call silently fails.
Root Cause
Duplicate function definitions. The version at line 364 in kugetsu uses os.system() to call kugetsu_add_notification, which doesn't work because os.system() spawns a subprocess that cannot access bash functions.
Fix
Remove the update_queue_item_state definition from kugetsu. The fixed version in kugetsu-index.sh should be used since kugetsu sources kugetsu-index.sh.
Severity
High - Notifications broken for timeout errors in main kugetsu command