Skip to content

feat: add pre-migration analytics probe for device and DB-size distribution#7428

Draft
diegolmello wants to merge 2 commits into
developfrom
feat/native-1280-migration-probe
Draft

feat: add pre-migration analytics probe for device and DB-size distribution#7428
diegolmello wants to merge 2 commits into
developfrom
feat/native-1280-migration-probe

Conversation

@diegolmello

Copy link
Copy Markdown
Member

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 and expo-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_probe should 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

  • New feature (non-breaking change which adds functionality)

Checklist

  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

https://claude.ai/code/session_01TE9VsFTeXsXc8ssqeR8MJ7

…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
@diegolmello diegolmello requested a deployment to approve_e2e_testing June 22, 2026 19:09 — with GitHub Actions Waiting
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d125c2bb-5f3c-482a-abbd-cbf73483e250

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant