Repository navigation
refactor(db): migrate realm-java → Room (fixes 16 KB page size) + scroll-to-top FAB - #2
Conversation
The compose "+" FAB in the conversation list doubles as a scroll-to-top button: once the list is scrolled down it morphs into an up arrow and tapping it returns to the top instead of starting a new conversation. Icon re-syncs on Inbox<->Archived page changes. Verified on device (R5KL301NYYZ): scrolling reveals ↑, tap returns to top. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…B page size) realm-java (io.realm) is archived and ships librealm-jni.so with 4 KB-aligned LOAD segments, which triggers the Android 15+ 16 KB page-size incompatibility warning and would fail to load on 16 KB-enforcing devices. Migrate the entire persistence layer to Room (androidx.room) + framework SQLite, which ships no native library at all — eliminating the 16 KB issue at the source. What changed: - Domain models (13) stripped of RealmObject/RealmList/annotations -> plain Kotlin. - New Room layer in :data (data/db): 15 @entity + 2 junction tables, 5 @relation POJOs, TypeConverters, Entity<->model Mappers, 8 DAOs, QuikDatabase. - All 9 repositories rewritten off Realm onto DAOs. RxJava2 kept via room-rxjava2 (DAO Flowable -> Observable); live RealmResults -> Observable<List<X>> (observed) or List<X> (one-shot). In-place Realm mutations -> DAO @query UPDATEs. EmojiReactionRepository dropped its external `realm` param. - Presentation (~25 files: ViewModels/Presenters/adapters/States) adapted to the new reactive signatures; QkRealmAdapter base is now a plain List-backed RecyclerView.Adapter; scroll-to-top FAB preserved. - KeyManager, DI (QuikDatabase + DAO providers), QKApplication de-Realm'd. - Removed realm gradle plugin/deps/classpath from all modules; deleted RealmExtensions, QkRealmMigration, LiveRealmData. Data safety: the on-disk .realm file is NOT deleted. Room starts empty, so on first launch lastSync==0 triggers a full re-sync that rebuilds messages/ conversations/contacts from the OS Telephony provider (source of truth). A one-time importer to restore Realm-only metadata (archive/pin/block/name/draft, blocked numbers, content filters, scheduled messages) is a planned follow-up. Verified end-to-end on device (R5KL301NYYZ, debug build): app launches with no crash, fresh Room DB re-syncs and renders the full conversation list, opening a thread renders message history, and the new debug APK contains ZERO .so files (librealm-jni.so gone). Room's kapt validated all 15 entities and ~80 DAO queries. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Skipping CodeAnt AI review — this PR changes more than 100 files, which usually means a migration, codemod, or vendored drop. Line-level review on diffs this large produces duplicate findings on the same rewrite pattern and drowns out anything that actually matters. If you still want a review, comment |
|
Important Review skippedToo many files! This PR contains 101 files, which is 1 over the limit of 100. To get a review, narrow the scope: Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (104)
You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Why
realm-java(io.realm) is archived and itslibrealm-jni.sohas 4 KB-aligned LOAD segments → triggers the Android 15+ 16 KB page-size incompatibility warning and would fail to load on 16 KB-enforcing devices. This migrates the whole persistence layer to Room + framework SQLite, which ships no native library at all — eliminating the 16 KB issue at the source (the new debug APK contains zero.sofiles).What changed
RealmObject/RealmList/annotations).:data(data/db): 15@Entity+ 2 junction tables, 5@RelationPOJOs,TypeConverters, Entity↔model mappers, 8 DAOs,QuikDatabase.room-rxjava2(DAOFlowable→Observable); observedRealmResults→Observable<List<X>>, one-shot reads →List<X>; in-place Realm mutations → DAO@Query UPDATEs.EmojiReactionRepositorydropped its externalrealmparam.QkRealmAdapterbase is now a plainList-backedRecyclerView.Adapter.QKApplicationde-Realm'd. Removed realm gradle plugin/deps/classpath from all modules; deletedRealmExtensions,QkRealmMigration,LiveRealmData.Data safety
The on-disk
.realmfile is not deleted. Room starts empty, solastSync == 0on first launch triggers a full re-sync that rebuilds messages/conversations/contacts from the OS Telephony provider (the source of truth).Verification
End-to-end on a physical device (debug build):
.sofiles —librealm-jni.sogone.kaptvalidated all 15 entities and ~80 DAO queries;assembleDebug= BUILD SUCCESSFUL.🤖 Generated with Claude Code