Skip to content

Conversation

@phoepsilonix
Copy link

Even after TEMP_DIR has been deleted, notify-send may still be executed. In such cases, writing to the status file becomes impossible. Since the inability to obtain notify-send's exit code does not cause any critical issues, the behaviour will be changed to refrain from creating the status file.

/tmp/timeshift-3q3RPPLM/17680663453153557074: line 10: status: No such file or directory
                script.append ("echo ${exitCode} > status\n");

@ygerlach
Copy link
Contributor

ygerlach commented Jan 11, 2026

Why even bother with writing a script file? why not invoke the command directly using Process.spawn_async_with_pipes ?

If you need a shell to do some parsing you could use bash -c "...".
It think we should work towards no generated script files at all in timeshift, but i guess thats a personal opinion.

You could make the functions, that are not needed outside private.

save_bash_notify_temp looks pretty much identical to save_bash_script_temp maybe some part of the code (ex. the part actually writing the file) could be deduplicated into a function? Of cause only if we keep the script and save_bash_script_temp at all.

The bug you are fixing here might be happening to other parts where we call a script async.

@phoepsilonix
Copy link
Author

phoepsilonix commented Jan 11, 2026

Why even bother with writing a script file? why not invoke the command directly using Process.spawn_async_with_pipes ?

If you need a shell to do some parsing you could use bash -c "...". It think we should work towards no generated script files at all in timeshift, but i guess thats a personal opinion.

You could make the functions, that are not needed outside private.

save_bash_notify_temp looks pretty much identical to save_bash_script_temp maybe some part of the code (ex. the part actually writing the file) could be deduplicated into a function? Of cause only if we keep the script and save_bash_script_temp at all.

The bug you are fixing here might be happening to other parts where we call a script async.

That might be right.
Indeed, when notifications were changed to asynchronous previously, there may have been other repercussions.

#475
https://github.com/ygerlach/timeshift/blob/3c01e942976138fc3ef6b78c211d01e72353b0dc/src/Utility/TeeJee.System.vala#L97

…etion.

Even after TEMP_DIR has been deleted, notify-send may still be executed.
In such cases, writing to the status file becomes impossible.
Since the inability to obtain notify-send's exit code does not cause any
critical issues, the behaviour will be changed to refrain from creating
the status file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants