Conversation
kaloudis
force-pushed
the
fix/android-preset-wallet-pictures
branch
from
September 22, 2026 15:34
48003c2 to
b90a8a2
Compare
SetWalletPicture derived the preset name from the resolved asset URI. On Android release builds React Native resolves bundled images to a resource identifier such as `assets_images_zeus_illustration_1a`, which has no `/`, so the name became `assetsimageszeusillustration1a`. getPhoto could not match it and returned an empty URI, leaving the wallet picture blank for every built-in icon since v13.0.0. Key the presets by name in PhotoUtils and pass the name straight through from the picker, so no platform-specific URI parsing is involved. Values already saved with the `assetsimages` prefix are still resolved. Fixes ZeusLN#4536
kaloudis
force-pushed
the
fix/android-preset-wallet-pictures
branch
from
September 22, 2026 15:39
b90a8a2 to
e12e5b1
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.
Description
Relates to issue: #4536
Fixes #4536. On Android release builds, none of the built-in wallet pictures could be saved; custom uploads worked. This has been broken since v13.0.0.
Root cause:
SetWalletPictureworked out the preset name (preset://<name>) from the image URI returned byImage.resolveAssetSource. React Native builds that URI differently on each platform:http://localhost:8081/assets/assets/images/zeus_illustration_1a.jpg?...zeusillustration1a✅file:///…/assets/images/zeus_illustration_1a.jpgzeusillustration1a✅assets_images_zeus_illustration_1a(resource identifier, no/)assetsimageszeusillustration1a❌getPhotodidn't recognise the Android name and returned'', so the preview and the saved wallet picture came out as an empty circle. History: 02b7d4d renamed the illustrations to use underscores, which broke the old "text after the last_" parsing. 024d1e6 then switched to splitting on/, which works in dev and on iOS but breaks every preset on Android release. Its tests only used dev-server URIs.Fix:
utils/PhotoUtils.tsnow keeps a single map from preset name to image, plus the list of presets per backend. The picker passes the name straight through, so names are no longer parsed out of platform-specific URIs.getPhotostrips theassetsimagesprefix from values already saved by v13.x Android builds, so those wallets show their picture again without a data migration.SetWalletPictureuses the preset names and drops its duplicated image lists andgetPresetName.getPhoto, and the legacy Android values must render.Not handled:
preset://1a-style values saved only by the v13.0.0 alpha builds.This pull request is categorized as a:
Checklist
yarn run tscand made sure my code compiles correctlyyarn run lintand made sure my code didn’t contain any problematic patternsyarn run prettierand made sure my code is formatted correctlyyarn run testand made sure all of the tests passTesting
If you modified or added a utility file, did you add new unit tests?
I have tested this PR on the following platforms (please specify OS version and phone model/VM):
Not yet tested on a device. Still needed on an Android release build: pick a preset, save, and check the picture in the wallet header, the Wallets list and the Menu. Also open a wallet saved with the broken value on v13.x and confirm its picture now appears.
I have tested this PR with the following types of nodes (please specify node version and API version where appropriate):
On-device
Remote
Locales
Third Party Dependencies and Packages
yarnafter this PR is merged inpackage.jsonandyarn.lockhave been properly updatedOther:
🤖 Generated with Claude Code