Skip to content

fix: handle Room 3 empty queries and improve release obfuscation - #6655

Merged
crossle merged 3 commits into
masterfrom
fix/room3-empty-queries-and-obfuscation
Sep 10, 2026
Merged

fix: handle Room 3 empty queries and improve release obfuscation#6655
crossle merged 3 commits into
masterfrom
fix/room3-empty-queries-and-obfuscation

Conversation

@SeniorZhai

Copy link
Copy Markdown
Member

Opening a bot profile can crash when its creator is not cached: Room 3 throws for the empty LiveData<User> query before the existing null-triggered refresh runs. Make 12 single-row observation queries nullable across user, conversation, circle, address, asset/token, and sticker DAOs. Propagate the types through their callers and let sticker preview wait for a missing sticker to load.

Review of generated empty-result checks in 70 DAO implementations found no further equivalent optional-row queries. Aggregate wallet summaries and the required local encryption identity retain their non-null contracts.

Also narrow R8 keep rules for annotated API fields and non-public Kotlin runtime classes while retaining persisted serialization models, JobQueue jobs, unannotated JSON fields, enums, throwables, and reflected coroutine stack-trace labels.

Measured from the final Google Play release AAB's BUNDLE-METADATA/com.android.tools/r8.json, against master 464502fa05 with the same toolchain:

Metric Before After Change
Obfuscation 49.65% 53.14% +3.49 percentage points
Optimization 54.18% 53.07% -1.11 percentage points
Shrinking 56.58% 60.25% +3.67 percentage points

Obfuscation improved by approximately 7.0% relative to baseline. DEX size decreased from 48,292,016 to 46,529,760 bytes.

Validation:

  • Final Google Play release AAB and APK builds completed, including lintVital tasks. Existing third-party SDK warnings remain; mapping upload tasks were excluded.
  • Three targeted JVM tests passed. The database test covers all 12 missing-row queries; each newly fixed query reproduced the corresponding Room exception before its fix.
  • Local post-R8 JVM smoke checks covered JSON round trips, baseline-to-current Java deserialization, enums, coroutine resumption, and reflected stack-trace labels.
  • Device release checks covered wallet assets/transaction details, crypto/perpetual lists and details, charts, market search, chat/App Card rendering, settings, and appearance. The bot-profile crash was reproduced, then retested successfully after the user-query fix, together with shared-media empty states and background/foreground return.

The subsequent 10-query sweep passed JVM tests and the final release build; a periodic device PIN reminder prevented repeating the full UI pass for that sweep. Actual transfers/trades, PIN/signing, and historical media restoration were not exercised. Push registration remains unverified because the local Firebase configuration was rejected.

@SeniorZhai SeniorZhai added the bug Something isn't working label Sep 9, 2026
@crossle
crossle merged commit 09c52fe into master Sep 10, 2026
1 check passed
@crossle
crossle deleted the fix/room3-empty-queries-and-obfuscation branch September 10, 2026 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants