Fix ROCKNIX credentials and offline caching on dual-screen devices (#92, #95) - #98
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #92. Fixes #95.
Both issues come from the same fact: on ROCKNIX,
retroarch.cfgis not the source of truth. RetroArch is launched as--config .../retroarch.cfg --appendconfig /tmp/.retroarch.cfg, and the append layer outranks the main config.#92 — "Login Required"
setsettings.shruns on every game launch and, for each key it manages, seds it out ofretroarch.cfgand writes the live value into the appendconfig instead.cheevos_usernameandcheevos_passwordare managed that way;cheevos_tokenandcheevos_custom_hostare not, which is why the symptom only appears on devices without a persisted token.The reporter's device showed the failure exactly:
retroarch.cfgheld acheevos_tokenwith nocheevos_username(unusable, since both are required), while the username/password pair sat in the appendconfig we never read.Both credential paths now consult it:
auth.resolve_credentials— the service path, used for caching and awardsretroarch_cfg.load_retroarch_credentials— the menu path behindis_logged_in, which draws the status lineMissing the second one is what made alpha8 still report "Login Required" while the service could log in perfectly well. That path had no test coverage at all; it does now.
The appendconfig is written to without truncation between launches, so it is parsed last-wins to match RetroArch.
#95 — "Invalid JSON" offline
On dual-screen devices
runemu.shappendscheevos_custom_host = "http://127.0.0.1:4874"and starts/usr/share/lowerdeck/ra_proxy.py, ROCKNIX's own proxy for the bottom-screen achievement UI. It is a verbatim pass-through with no cache, and offline it answers 502 with an empty body — which RetroArch reports as "Invalid JSON". Because it arrives via the appendconfig, our patched host can never win.Rather than compete for the port, we start their script ourselves using its own documented flags:
runemu.shonly starts an instance when itspgrepfinds none, so ours stays in charge.--retroarch-process-match ""disables their watchdog, which would otherwise shut our instance down and let ROCKNIX restart it pointed straight at RetroAchievements. Because that watchdog is off, we stop the child on service shutdown — leaving it behind would point RetroArch at a dead port and break achievements outright, which is worse than the bug.Every gate fails closed: nothing happens off ROCKNIX, on single-screen devices, or when the script is absent.
Note that
DEVICE_HAS_DUAL_SCREENis not a device whitelist — ROCKNIX counts connected connectors withmodetestat boot, so a single-screen handheld booted with HDMI attached also qualifies.Verification
Confirmed on an AYN Thor (ROCKNIX 20260801) over SSH:
A request sent to their proxy on 4874 came out of our service log. Then confirmed on a clean install: credentials resolved, login and status correct, game cached, and offline play working.
The reporter independently confirmed both fixes on the same hardware, and that the bottom screen still displays achievements — so chaining preserves ROCKNIX's feature rather than displacing it.
18 new tests, 439 passing.