Problem
h_launch_app in simulator/sim_socket_handler.c (~line 396) queues the requested app name and unconditionally returns {"ok": true}. The actual lookup happens later, on the OS poll loop, via launcher_launch_by_name(). If the name doesn't match anything in s_apps[], that lookup silently no-ops — but the RPC caller has already been told the launch succeeded.
static char *h_launch_app(const char *params) {
char name[128] = {0};
json_get_str(params, "name", name, sizeof(name));
if (!name[0]) {
return strdup("{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32602,\"message\":\"name required\"}}");
}
s_pending_launch = strdup(name);
static char buf[256];
snprintf(buf, sizeof(buf),
"{\"jsonrpc\":\"2.0\",\"result\":{\"ok\":true,\"app_name\":\"%s\"}}", name);
return strdup(buf);
}
Compounding this: scan_apps() (src/os/launcher.c) runs once at boot. Any app staged onto the SD card after the simulator process has already started is invisible to the launcher for the lifetime of that process — while launch_app still reports success.
Impact
This cost real debugging time during e2e test development: a launch RPC would report ok: true and the test would then wait/poll for behavior that could never happen, with no error signal pointing at the actual cause (stale app list / typo'd app name).
Suggested direction
- Validate the requested name against
s_apps[] in h_launch_app (or at the point s_pending_launch is consumed) and return an RPC error if it isn't found.
- Consider adding an RPC to trigger
scan_apps() again, so tests don't need to restart the simulator after staging a new app onto the SD image.
Context
Surfaced while implementing Stage 0/1 of the C-Dogs asset-memory redesign (local specs, not tracked in this repo). Parent commits e9b1622e..21a9b389.
Problem
h_launch_appinsimulator/sim_socket_handler.c(~line 396) queues the requested app name and unconditionally returns{"ok": true}. The actual lookup happens later, on the OS poll loop, vialauncher_launch_by_name(). If the name doesn't match anything ins_apps[], that lookup silently no-ops — but the RPC caller has already been told the launch succeeded.Compounding this:
scan_apps()(src/os/launcher.c) runs once at boot. Any app staged onto the SD card after the simulator process has already started is invisible to the launcher for the lifetime of that process — whilelaunch_appstill reports success.Impact
This cost real debugging time during e2e test development: a launch RPC would report
ok: trueand the test would then wait/poll for behavior that could never happen, with no error signal pointing at the actual cause (stale app list / typo'd app name).Suggested direction
s_apps[]inh_launch_app(or at the points_pending_launchis consumed) and return an RPC error if it isn't found.scan_apps()again, so tests don't need to restart the simulator after staging a new app onto the SD image.Context
Surfaced while implementing Stage 0/1 of the C-Dogs asset-memory redesign (local specs, not tracked in this repo). Parent commits
e9b1622e..21a9b389.