-
-
Notifications
You must be signed in to change notification settings - Fork 27
Grout exits silently with no message when no mapped platform has ROMs #267
Description
Describe the bug
When none of the platforms in directory_mappings matches a RomM platform that has ROMs, Grout exits immediately with status 0 — no message, no error dialog, and nothing in the log. From the user's side it is indistinguishable from a crash: the app is launched, the splash appears, and a moment later you are back at the launcher.
The silent exit comes from ui/platform_selection.go, where an empty platform list returns the default Quit action before anything is drawn:
output := PlatformSelectionOutput{ Action: PlatformSelectionActionQuit, ... } if input.Platforms == nil || len(*input.Platforms) == 0 { return output, nil }
internal.GetMappedPlatforms builds that list with an exact, case-sensitive lookup plus a ROMCount > 0 filter:
_, exists := mappings[platform.FSSlug] if exists && platform.ROMCount > 0 { platforms = append(platforms, platform) }
So a saved mapping whose key no longer matches the server's fs_slug — including a difference in case only — silently drops the platform. cache.populateCache also returns straight away on an empty list, so the "Building cache..." progress bar flashes for a fraction of a second and the cache DB stays empty, which adds to the impression that something crashed.
Reproduction Steps
- Configure a RomM library whose
fs_slugvalues differ in case from the platform slugs, e.g. folders namedGB,GBA,GBC. - Complete the first-launch platform mapping so
directory_mappingsends up keyed ongba/gbc(lowercase), or editconfig.jsonby hand to simulate it. - Launch Grout.
Observed: the app exits on its own within a second of the router starting. Exit status 0, no log line, no dialog.
Expected Behavior
Grout should tell the user what is wrong rather than disappear. Any of these would be enough:
- a message such as "No mapped platform has any ROMs — check your platform mapping", with a way to jump straight into the mapping screen;
- at minimum, a log line recording how many platforms the server returned, how many mappings exist, and how many survived the filter.
A case-insensitive lookup on fs_slug would also avoid the most common way of ending up here, though it is arguably a separate change.
Information
- CFW: n/a — reproduced while porting to the Anbernic stock OS, but the code path is CFW-agnostic
- CFW Version: n/a
- Handheld Device: Anbernic RG35XX Plus
- Grout Version: built from
mainat v5.1.0.0 - RomM Version: 5.2.0
Diagnostics
Adding a temporary log line to GetMappedPlatforms produced this, which is what made the cause obvious:
DIAG platform fs_slug=GB name="Game Boy" rom_count=52 mapped=false
DIAG platform fs_slug=GBA name="Game Boy Advance" rom_count=25 mapped=false
DIAG platform fs_slug=GBC name="Game Boy Color" rom_count=73 mapped=false
DIAG platform fs_slug=3ds name="Nintendo 3DS" rom_count=0 mapped=true
DIAG platform fs_slug=nds name="Nintendo DS" rom_count=0 mapped=true
DIAG mapped platforms result from_server=6 mappings=4 kept=0
Without that instrumentation there is no signal at all to work from.