Files
hermes-agent/apps
Jack Lau 022647f131 fix(desktop): give the gateway save dialog a file type to keep
Both gateway save dialogs opened with no filters. Electron passes filters to
the platform save dialog as its set of file types, so with none supplied the
Windows dialog has exactly one type, "All Files", and no default extension for
the shell to append. The resolved name reaching the dialog is correct and
carries its extension; the dialog is where it goes missing, and a .pptx then
lands as a typeless "File" that Explorer cannot open (#92480).

The image-save dialog in the same file already carries a filter for exactly
this reason, with a comment naming the same platform and the same symptom. The
gateway file path never got the same treatment.

saveDialogFilters offers the download's own type ahead of All Files, so the
dialog names the type and Windows has an extension to keep. All Files stays
last on every branch: a filter list without it turns a save dialog into a
rename requirement.

The extension is whitelisted rather than merely extracted, because the name it
comes from can be server-supplied through Content-Disposition. Anything failing
the test falls back to All Files, which is today's behaviour, so the guard can
only decline to improve a save, never break one.

Both call sites are fixed. A fix that reached only the streaming path would
leave the bug alive on any gateway old enough to 404 that route into the
data-url fallback.
2026-09-29 19:22:42 -05:00
..