Repository navigation
Installer: accept a widget icon trailer, strip it for stubs before 10 - #117
Draft
freethinkel wants to merge 1 commit into
Draft
freethinkel wants to merge 1 commit into
freethinkel wants to merge 1 commit into
Conversation
A .wp2app may carry its widget icons after the relocation table (cmf-watch-sdk docs/app-icons.md, "Widget icons"). planInstall refused such a package as "truncated or padded". It now checks the trailer (magic, version, count 1..16, size 40, zero pad, length, CRC) and refuses a broken one as "broken widget icon trailer", translated in every locale. A package without a trailer still has to match its exact size, and the body CRC now covers only image and relocations, as the header says. Stubs before 10 refuse any byte past the relocations, so planInstall hands back the body to send: the package whole for stub 10 and later, cut at the relocations for an older stub. installPackage sends that body, and its size and CRC go into BEGIN. The fixtures are built by cmf-watch-sdk's package.pack (widget-templates): an app with 2 icons, and the same app packed without them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CQSU8MAPYkhktGkGdxdk2C
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.
What
Watch apps (
.wp2app) can now carry their widget icons in a trailer after the relocation table. The spec is cmf-watch-sdkdocs/app-icons.md"Widget icons", from thewidget-templatesbranch (cmf-watch-sdk PR #23, still a draft). Until nowplanInstallrefused such a package as "truncated or padded". The first package with icons will be Weather 0.2.0.planInstall(device/lib/wp2.ts) accepts a well-formed trailer:WP2W, version 1, count 1..16, size 40, a zero pad byte, length12 + count·4800, and the CRC32 of the pixels. A broken trailer is refused as "broken widget icon trailer", and that message is translated in all five locales indevice/messages.ts.planInstallreturnsbody, the bytes to send. From stub 10 on that is the whole package. A stub before 10 gets the package cut at the relocations, which is the same bytes aspackage.strip_trailer.Watch.installPackagesendsbody, and BEGIN carries its size and CRC. The stub version comes from thereadWp2state that the installer already receives.fetchLoaderHeadersFx/ app header fetch and the dev panel'ssniffonly read the 64-byte header. Nothing displays a package size, and there is no upload path.Fixtures
tests/__fixtures__/icons.wp2app(2 icons, 10 708 B) andicons-stripped.wp2app(1 096 B) were built with cmf-watch-sdk'spackage.packat 7966ba2. The CLI'spackneeds a linked ELF, so I called the same function the SDK's own tests call, and assertedstrip_trailer(full) == plain.Checks (local)
wp2.browser.test.tscases failed ontruncated or paddedbefore the change.pnpm lint: passed (0 errors; the warnings are in files this PR doesn't touch).pnpm format:check: passed.pnpm check: passed, 0 errors, 0 warnings.pnpm test(Playwright headless Chromium, as in CI): passed, 87 files, 492 passed, 1 skipped, 0 failed. An earlier full run had one failure intree-panel-drag.browser.test.ts, an editor test this PR doesn't touch. It passed when run alone and in this rerun, so it is a flake under load.pnpm build: passed.Not run
Merging
Merging to
maindeploys. There is no deploy job in CI: kuzyo pollsmainand deploys a commit once CI passes on it (deploy/autodeploy.sh). After this merges, the live store will accept and install packages with widget icons.🤖 Generated with Claude Code
https://claude.ai/code/session_01CQSU8MAPYkhktGkGdxdk2C