Skip to content

Explain and fix a Filee that Explorer can't reach (#99) - #108

Merged
KnifeLemon merged 5 commits into
mainfrom
fix/elevated-and-diagnostics
Oct 18, 2026
Merged

KnifeLemon merged 5 commits into
mainfrom
fix/elevated-and-diagnostics

Conversation

@KnifeLemon

Copy link
Copy Markdown
Owner

Summary

Background (#99): a user found every GUI path dead after installing: the gesture, the shortcut, Explorer's "Convert with Filee", and dropping files on the main window (red no-entry cursor). The CLI worked and the log was empty. The likely cause is Filee running elevated while Explorer isn't, so UIPI blocks drag-drop, the selection read and the second instance's mutex and pipe. Nothing detected or logged this.

Elevation

  • On Windows, Filee compares its integrity level with Explorer's (Elevation.Probe, ElevationState).
  • When Filee is higher, it logs a warning and shows a banner on Home plus a one-time card. Both offer "Restart without administrator rights": release the mutex, relaunch through Explorer's shell (FindWindowSW(SWC_DESKTOP) → IShellDispatch2.ShellExecute), then quit. If the relaunch fails, Filee keeps running and says so.

Second instance

  • If acquiring the mutex fails with access denied (an elevated Filee owns it), Filee logs it and shows a native message box.
  • Forward reports Delivered, NoAnswer or AccessDenied. On failure it logs and tells the user once, using the shared mutex, instead of exiting silently.

Diagnostics

  • Startup line: version, exe path, installed or portable, integrity levels, OS and argument count.
  • Global unhandled exceptions are logged, through an early logger before Avalonia starts.
  • A UI watchdog logs "blocked for N s" and "responsive again".
  • Rate-limited logs for:
    • forwarded requests
    • drags that never reached the donut
    • empty selection shortcuts, with the foreground window class and process
    • the first drop-zone drag

Robustness

  • ffmpeg -version and -encoders timeouts now really apply: async reads, and the process is killed on timeout.
  • Engine statuses are computed in the background at startup.
  • Unreachable UNC entries on PATH are skipped after 2 s.

Test plan

  • Core 220, Engines 832, Cli 21, Platform 18 and App 288 passed. dotnet format is clean.
  • New tests cover:
    • the watchdog (manual clock) and rate limiting
    • startup log format and the early logger
    • the restart sequence and its failure handling
    • the Home banner
    • SingleInstance NoAnswer, and AccessDenied (Windows, using a pipe ACL)
    • the integrity decision
    • background catalog checks, UNC detection and process timeout/kill
  • Not verified for real: an actually elevated Filee, and the Explorer relaunch (ShellExecute). They need UAC.

Note: FfmpegConverter.VersionOf/EncodersOf overlap slightly with the hardware-encoding branch (#100).

🤖 Generated with Claude Code

KnifeLemon and others added 2 commits October 17, 2026 23:53
calibre's GitHub releases keep files only for the newest version: when 9.16.0
came out, the pinned 9.15.0 .txz and .dmg links there started returning 404,
so installing calibre failed on macOS and Linux. download.calibre-ebook.com
keeps every version; the files are the same (sizes and SHA-256 checked).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Filee running as administrator (started by an installer run elevated)
ignores drops from Explorer, can't read Explorer's selection, and the
Filee that Explorer's menu starts crashed on the elevated Filee's mutex
or waited 30 s on its pipe, all without a log line.

- Read Filee's and Explorer's integrity levels at start-up. When Filee
  runs elevated and Explorer doesn't: log a warning, show a banner on
  the Home page and a one-time notice card, both with "Restart without
  administrator rights" (relaunch through Explorer's shell, after
  releasing the single-instance lock; a failed restart says so).
- A later launch that can't open the lock or is refused by the pipe
  logs it and shows one message box (once per burst of launches); the
  pipe refusal no longer waits the whole 30 s.
- Log unhandled exceptions (any thread, unobserved tasks, UI thread)
  through a logger set up before anything else, and one start-up line
  with version, path, install kind, integrity levels, OS and argument
  count.
- UI watchdog: logs a UI thread blocked for more than 5 s and when it
  answers again.
- Rate-limited diagnostics: forwarded launches received and handled,
  drag gestures that never reached the donut, shortcuts that found no
  selection (with the foreground window), the first drag over the drop
  zone.
- FFmpeg -version / -encoders time out for real (background reads, kill
  on timeout); engine statuses are checked once in the background at
  start-up; unreachable network shares on PATH are skipped after 2 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Avalonia toggles the selected item of a ComboBox or ListBox off when it is
picked again with the command modifier (Ctrl+Space, Ctrl+Enter, Ctrl+click;
Cmd on macOS). A combo box was left empty and pushed null into settings that
always hold a value, which threw NullReferenceException in the view models
(e.g. TriggerGestureViewModel) and showed it under the combo box.

- SingleSelectionGuard (registered in App.Initialize) swallows that toggle on
  the selected item of combo boxes and single-selection list boxes; an open
  drop-down closes as after any pick. Multi-selection lists keep the toggle.
- Choices.Restore: every Choice<T> property (Triggers, Presets editor,
  General, Theme, Watch folders, rename rules) and the navigation selection
  ignore null and keep their previous value; the control then reads the bound
  value again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@KnifeLemon KnifeLemon mentioned this pull request Oct 18, 2026
@KnifeLemon
KnifeLemon merged commit 88cbfb3 into main Oct 18, 2026
5 checks passed
@KnifeLemon
KnifeLemon deleted the fix/elevated-and-diagnostics branch October 19, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant