fix(queue-daemon): call kugetsu_add_notification from bash instead of os.system() #167
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
When update_queue_item_state() sets state to 'completed' or 'error' in kugetsu-index.sh, it tries to call kugetsu_add_notification via os.system():
This fails silently because os.system() spawns a NEW subprocess, and bash functions are not visible to child processes. kugetsu_add_notification is a bash function, not an executable command.
Impact
Root Cause
os.system() creates a new shell subprocess that cannot access bash functions defined in the parent shell.
Expected Fix
Call kugetsu_add_notification directly from bash in update_queue_item_state(), not via os.system(). The function is available since kugetsu-index.sh is sourced before update_queue_item_state is called.
Alternative: Make notification a standalone script that can be called via PATH.
Severity
High - Notifications broken for completed/error states