feat: validate app compatibility with the TV - #241
Open
beatcracker wants to merge 1 commit into
Open
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.
Goal
Turns out HBC never actually checks app compatibility requirements - I only noticed when people started reporting my app crashing on TVs it was not compatible with.
This PR adds non-blocking compatibility warnings for webOS version, TV SoC, and root access. Warnings show up on the app details screen. If something is definitely incompatible, HBC asks for confirmation before install/update/reinstall, but nothing is ever hard-blocked, users can always proceed.
Apps that don't declare any requirements behave exactly as before.
Screenshots
Implementation notes
The annoying part was version ranges: they need to match the Cargo-style ranges that
ipk-verifyuses on the Rust side. I went with the existingsemverpackage plus a small adapter that covers the range forms actually used in apps-repo today. It deliberately does not implement the full Cargo grammar. Anything it can't parse just produces a warning.Everything is best-effort: if HBC can't figure out the TV's webOS version, SoC, or root status, that shows up as
unknownand install stays available.Testing
Tested on a real C2 (warning + confirmation flows, install/reinstall after confirming), plus unit tests for the requirement evaluation. UI still fits the TV screen even with all three warnings at once, no overflow or or buttons moved around.
Note
Heads up in case you care about this kind of thing: the code is LLM-assisted, with heavy guidance from me. 😅