Skip to content

Navigation Menu

Sign in
Sign up

Grout exits silently with no message when no mapped platform has ROMs #267

Open

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

  1. Configure a RomM library whose fs_slug values differ in case from the platform slugs, e.g. folders named GB, GBA, GBC.
  2. Complete the first-launch platform mapping so directory_mappings ends up keyed on gba / gbc (lowercase), or edit config.json by hand to simulate it.
  3. 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 main at 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      AltStyle によって変換されたページ (->オリジナル) /