Repository navigation
Conversation
G HUB depots name their renders by a path inside the depot (`images/device/<uuid>`). The fetch and the resolver joined every file name with `safe_component_path`, which accepts a single component only, so a G502 X PLUS colour variant never downloaded its front and side renders and could not have drawn them. Join depot files with the new `safe_relative_path`, which checks every `/`-separated segment with the same rules, and create the parent directory on write. The side view also looked its variant up by registry model id only, while the sync downloads by the manifest bases that include the depot name, which G HUB manifests key on. Resolve it through `find_variant_in_manifest` like the other variant renders. Fixes #2457
The per-device sync listed the five manifest keys it downloads inline. The offline bundle needs the same answer for every variant, so the list moves to openlogi_assets::manifest, private, behind two decisions: DepotManifest::consumed_srcs_for names one variant's files and DepotManifest::consumed_srcs names every variant's. The sync now asks consumed_srcs_for, which also parses the manifest once instead of once per key. The assets-consumed-resources-owner ast-grep guard rejects a key list or key match anywhere else.
`openlogi assets sync` chose a depot's optional files by Options+ name pattern (`side_core.png`, `front_ext*`, `metadata_*`), so the offline bundle never carried a render the manifest names any other way: the `images/device/<uuid>` paths of the 45 G HUB depots, G HUB colour names such as `front_white.png`, and WebP renders. A bundled build then drew those devices on the base render with no side view, and its runtime sync stays off, so nothing filled the gap. The manifest now lands first and bundle_files adds every file it names for a consumed resource, across all variants (DepotManifest::consumed_srcs). Only registry-listed names are selected, so every bundled file still carries a registry hash. The summary counts the manifest fetch once and sums the selection it actually bundled. Fixes #2459
[Medium impact] This PR appears safe to merge; no actionable issues were found. SummaryThe CLI now bundles registry-listed files named by consumed manifest resources across every device variant.
AprilNEA explicitly deferred runtime downloads for missing bundled files. This review does not treat that known limitation as a new issue.
|
AprilNEA
force-pushed
the
fix/asset-sub-path-resources
branch
from
November 8, 2026 13:30
c34f7ac to
ee9d52c
Compare
This branch has not been deployed
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.
Summary
openlogi assets syncbuilds the offline asset bundle (OPENLOGI_BUNDLE_ASSETS=1). It picked each depot's optional files by Options+ name pattern (side_core.png,front_ext*,metadata_*), so the bundle left out every render the depot manifest names some other way:images/device/<uuid>paths: 45 G HUB depots, 98 files, 88.0 MiB (the G502 X PLUS is one of them);front_white.png,front_lol.png, …), WebP renders,Front.png,k380_front.png,config_core.png.A bundled build turns its runtime sync off (
should_run(has_bundle)), so those devices stay on the base render with no side view.Scope: the official release builds do not bundle. Both v0.9.0 macOS jobs log
device assets: on-demand (not bundled; fetched at first launch)becausevars.OPENLOGI_BUNDLE_ASSETSis unset. Only self-built offline bundles are affected.Stacked on #2461, which adds the
safe_relative_pathjoin that lets sub-path names be fetched. Merge #2461 first; this branch then rebases ontomaster.Changes
openlogi-assets: the list of manifest keys OpenLogi consumes (device_image,device_buttons_image,device_side,device_camera_image,image_metadata) is now private inmanifest.rs, behind two decisions:DepotManifest::consumed_srcs_for(bases, ext)names one variant's files,DepotManifest::consumed_srcs()names every variant's. New ast-grep guardassets-consumed-resources-owner(ruleDir added tosgconfig.yml) rejects a key list or key match anywhere else.openlogi-desktop:sync_depotasksconsumed_srcs_forinstead of listing keys inline, and parses the manifest once instead of once per key. Same selection as before.openlogi-cli:assets syncfetches the manifest first;bundle_filesthen selects the baseline, the flat-named optional files, and every registry-listedsrcunder a consumed key, across all variants. Names the registry does not list are not selected, so every bundled file still carries a registry hash. The size summary is the sum of what was selected.Effect on the current catalog (v0-1, 2026-11-08): bundle 1146 files / 395.0 MiB → 1352 files / 625.2 MiB (+206 files, +230.2 MiB). Four consumed
srcvalues are missing from the index and stay out.Not done: letting a bundled build fetch missing files at runtime (option 3 in #2459). That changes when a bundled build goes online, and the official builds do not bundle in the first place.
Testing
openlogi-clibundle_files_tests::a_g_hub_depot_bundles_the_renders_its_manifest_names: fails when the selection ignores the manifest (checked by disabling that branch). Alsoa_manifest_src_the_registry_does_not_list_is_not_bundledandwithout_a_manifest_only_the_flat_names_are_bundled.openlogi-assetsmanifest::tests(4): every-variant selection with dedup and unconsumed keys skipped, one-variant selection, first base wins per resource, unknown variant.g512_photo_and_metadata_are_selected_for_downloadnow goes throughvariant_filenames.sync.rskey array and on a CLI probe with a key array and a keymatch; unrelated arrays such asKEY_MARKER_IMAGESpass.g502x_plus(files copied from Pages),openlogi assets sync --base http://127.0.0.1:18765: 9 files including the 6images/device/*renders, none ofpromotion/*,battery*,splash*; a second run reports 9 cache hits.sgconfig.ymlchanged:cargo fmt --check,cargo clippy --workspace --all-targets -D warnings,cargo test --workspace, rustdoc,ast-grep scanandast-grep scan .github, typos.Not run locally: macOS and Windows clippy/tests (left to CI). Not tested: a real
cargo xtask macos packagewithOPENLOGI_BUNDLE_ASSETS=1.Fixes #2459