feat: add pre-migration analytics probe for device and DB-size distribution#7428
Draft
diegolmello wants to merge 2 commits into
Draft
feat: add pre-migration analytics probe for device and DB-size distribution#7428diegolmello wants to merge 2 commits into
diegolmello wants to merge 2 commits into
Conversation
…bution Fire-once probe (guarded by an MMKV flag) that logs device model, OS, free disk, and total WatermelonDB on-disk byte size via the existing Firebase Analytics / Bugsnag event pipeline. Fires on first server select after login. Gives the team real-world data before the SQLCipher migration ships. Claude-Session: https://claude.ai/code/session_01TE9VsFTeXsXc8ssqeR8MJ7
…m comments - statDbWithSidecars: sum main + -wal + -shm per database so the reported footprint matches what WAL mode actually keeps on disk; missing sidecars contribute 0 (normal between checkpoints), main absent → null - runDbMigrationProbe: move getBool guard inside the try/catch so any MMKV failure is silently swallowed, preserving fire-and-forget semantics - events.ts: drop the inline TODO from the probe comment - dbMigrationProbe.ts: remove redundant documentDirectory value comment Claude-Session: https://claude.ai/code/session_01TE9VsFTeXsXc8ssqeR8MJ7
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
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.
Proposed changes
Fire-once probe that collects device model, OS version, free disk space, and total WatermelonDB on-disk size via the existing Firebase Analytics / Bugsnag event pipeline (
db_migration_probe). Guards with an MMKV boolean flag so it fires at most once per install, triggered on first server select after login.The team needs this data to size the upcoming SQLCipher migration: real-world DB sizes and device OS distribution before migration code ships.
No new native modules — uses
react-native-device-info(already installed) for device/disk info andexpo-file-system/legacy(already installed) for file stats. No PII, no auth tokens, no message content — byte counts and device facts only.Issue(s)
https://rocketchat.atlassian.net/browse/NATIVE-1280
How to test or reproduce
Wipe MMKV storage (or use a fresh install), log in to any server. The event
db_migration_probeshould appear in Firebase DebugView with fields:device_model,os_name,os_version,free_disk_mb,servers_db_bytes,total_db_bytes. Logging in again should not re-fire the event.Screenshots
N/A — analytics-only change, no UI.
Types of changes
Checklist
https://claude.ai/code/session_01TE9VsFTeXsXc8ssqeR8MJ7