Repository navigation
fix(resources): read Compose strings through the Compose loader on Android - #1911
Merged
Merged
Conversation
…droid #1894 moved the transaction-history titles from R.string to Res.string, and AndroidResources resolved a StringResource back to R by name with getIdentifier. Nothing references those strings by id anymore, so the release resource shrinker strips all 36 of them (resources.txt: "string:title_activity_sentTo ... is not reachable") and the lookup returns "". Feed rows with a resolved counterparty ("Sent to X", "Received from X", tips, boosts, converts) render with no title, as do the transaction-details titles, subtitles and status labels. Read the string with Compose's getString instead, as the desktop ComposeResourceHelper already does. The composeResources .cvr assets ship in the release APK and the shrinker leaves them alone.
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.
Activity feed rows with a known counterparty show no title in release builds: "Sent to X", "Received from X", tips, boosts and converts all render blank. Rows that use the server text verbatim ("Cancelled", "Purchased") are fine, which is why it looked limited to payment requests.
#1894 moved the transaction-history strings from
R.stringtoRes.string, andAndroidResources.getString(StringResource)resolved them back toRby name withgetIdentifier. With no id references left, the release resource shrinker removes all 36 strings in that module.mapping/release/resources.txtreportsstring:title_activity_sentTo ... is not reachable, and the strings are absent from the APK's resource table.getIdentifierthen returns null and the helper returns"". Besides the feed titles, the transaction-details titles, subtitles ("In person", "with X", "for X") and status labels go blank too.This reads the string with Compose's
getString, as the desktopComposeResourceHelperalready does. The module'scomposeResources.cvrfile ships in the release APK, and the shrinker doesn't touch assets. In a release build from this branch, it containstitle_activity_sentTo→Sent to %1$s.ResourceHelperStringResourceTestcouldn't catch this: Robolectric runs against unshrunk resources, and CI only builds debug. The same gap let #1908 through.