You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Toast notifications are displayed by a small piece of PowerShell script, which is run from a scheduled task.
When a notification is to be shown, a scheduled task which runs powershell.exe (to, in turn, run a script which calls Show-NotificationToast with the appropriate parameters) is instantiated, registered and immediately started (then immediately deleted).
The scheduled task is set to run with the logged in user as principal, which gives it the necessary permissions to display a toast notification to said user. The rdiffbackup-wrapper "original" script may be run by a different user, especially if run from a background scheduled task / job, which wouldn't have such permission: this is why a dedicated scheduled task is necessary.
The scheduled task runs PowerShell with -WindowStyle Hidden option, so that the PowerShell window doesn't appear as the notification script runs. However, it does briefly appear, then gets immediately hidden; this is due to a Windows limitation which unconditionally allocates a console to CUI applications (contrary to GUI ones).
This is a common problem (see for example this question on StackOverflow). Commonly suggested workarounds involve either hacky wrapping applications or tools, or running the task with Run whether user is logged on or not option which is quite obscure how to set programmatically and would run the task with a (different) privileged account, defeating the purpose of our scheduled task.
A proper Windows / PowerShell solution is being discussed on GitHub, and is likely to materialize at one point. Given all the above and the low impact of the flashing windows to the end user (especially since the toast notifications here are only used to notify of unexpected errors), it is preferable to wait for "upstream" (i.e. PowerShell / Windows) to fix it.
Right when a toast notification appears on the user desktop, a PowerShell window briefly flashes (appears and immediately disappears).
This can be reproduced by simply displaying a toast notification:
This behavior is not intended nor desired.
The text was updated successfully, but these errors were encountered: