Repository navigation
feat(hosts): draw images in the Pocket face preview - #1445
Open
valentinfernandez1 wants to merge 8 commits into
Open
valentinfernandez1 wants to merge 8 commits into
valentinfernandez1 wants to merge 8 commits into
Conversation
The debug face preview drew a face without its images, so checking an image change on a Pocket face needed a deploy. The preview loads Bulletin images through the IPFS gateway and archive images from the server that served the face, at the path they have in the published archive. An archive path that leaves that server or contains a `..` segment draws as empty space. The `..` check runs on the path itself because Android's URI drops a leading `..` that the JVM keeps. Pressing Draw again fetches the face and its images fresh. The face fetch skips the app's HTTP cache, which answered for edited faces, and the screen redraws even when the face file did not change, so an edited image shows. The Android dev loop guide covers images and an HTTPS tunnel for phones without adb.
The face is fetched with OkHttp, so its images now resolve with OkHttp's HttpUrl too. A face URL OkHttp accepts no longer fails java.net.URI's stricter parser, and the result is the same in unit tests and on the device. Drop KDoc from impl-module code, which the Android guide keeps for api modules.
A card reads an archive path as a file inside the archive. The preview resolved it as a URL, so it refused `images/badges/../stamp.png`, which a card draws, and normalised `\`, `%2e%2e` and `?query` into paths a card does not have. The preview now adds each path segment as a literal file name on the face's server, so an address cannot leave that server. Only a path that climbs above the root is refused, as the archive refuses it. Bulletin images keep the image cache. A CID names content that never changes, so only archive images skip the cache on each Draw.
Contributor
|
This pull request touches an app, which is not built by default. Add a label for each build you want:
Each starts as soon as it is added and follows the branch from then on. |
Contributor
Bundle size reportCompared with
WebAssembly modules
No file changed size. Commit: b85d056 |
Archive images skipped the memory cache entirely, so rotating the phone or changing theme fetched them again, which is slow through a tunnel. Their memory cache entry is now keyed by the draw, so each Draw still fetches an edited image while a single draw reuses what it loaded.
Contributor
|
CI Status: 24 required jobs green, 17 passed and 7 skipped by path filter. All job results
Signing credentials: failure as of 2026-10-15, a release may fail Commit |
…gain The per-draw memory cache key started again at 1 each time the preview opened, and the image cache is shared across the app. After leaving the preview, editing an image and drawing again, the old image came back from memory. Archive images skip the memory cache again, so every Draw asks the dev server. The new test doubles use mockk, as AGENTS.md asks for the Android host.
valentinfernandez1
marked this pull request as ready for review
October 15, 2026 14:46
The debug face preview now draws a face's images. A Bulletin image loads from the IPFS gateway the Pocket uses. An Archive image loads from the server the face came from, with its path read as a file name under the root, as a card reads it. A path that climbs above the root draws nothing, and a full address or a query in the path stays a literal file name. Pressing Draw again fetches the face and its archive images again, so edited files show without restarting the app. The face fetch skips the HTTP cache, and each draw gives the card a new identity. Overlapping loads of the same image now share one load. Kingfisher's async retrieve never returned for the second of two overlapping loads of one address, so a face showing the same image twice kept a spinner in one cell. This also affects real cards with a repeated image on a cold cache. The dev loop doc covers images in the preview and drawing on a physical iPhone through an HTTPS tunnel.
Contributor
|
This pull request touches an app, which is not built by default. Add a label for each build you want:
Each starts as soon as it is added and follows the branch from then on. |
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.
What
The Pocket face preview in the debug menu draws a face's images, on Android and iOS.
..draws as empty space.On iOS, overlapping loads of the same image share one load. Kingfisher never finished the second of two overlapping loads of one address, so a face showing the same image twice kept a spinner in one of them. This also applies to real cards.
The dev loop guides for both apps cover images and an HTTPS tunnel for a physical phone.
Why
So developers can check a face's images while working on it, without publishing. Requested in paritytech/platform-bugs#98.
Testing
..inside the archive. A path above the root and a path naming another server do not reach anything outside the face's server. An edited image and an edited face show after pressing Draw.