feat(apps): app-level stats_mode for device telemetry privacy - #3305
feat(apps): app-level stats_mode for device telemetry privacy#3305riderx wants to merge 3 commits into
Conversation
Add app-level stats_mode (all | updatesOnly | billingOnly) with dashboard UI, PUT /app API support, and server-side /stats enforcement aligned with Cap-go/capacitor-updater#860. Default remains full collection for all apps. Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks 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 |
Merging this PR will not alter performance
Comparing Footnotes
|
Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com>
|
@coderabbitai review |
Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com>
|
@coderabbitai review |
|
|
Community review — unique notes, not repeating the bot summaries.
|



Summary (AI generated)
apps.stats_modecolumn (all|updatesOnly|billingOnly) defaulting toallfor new and existing apps.PUT /public/app/:id(same pattern asexpose_metadata/allow_device_custom_id)./stats: drop disallowed actions and strip fields that should not be stored in restricted modes (defense in depth vs older plugins).Pairs with Cap-go/capacitor-updater#860 (
statsModeclient gating). Wire values match the plugin contract.Motivation (AI generated)
Customers in HIPAA-sensitive or strict App Store privacy (NSPrivacy) programs need an explicit, documented way to collect less device telemetry without disabling Capgo updates entirely. The native plugin PR adds client-side
statsMode; this PR stores the org policy on the app and enforces it on ingest.Business Impact (AI generated)
allpreserves current analytics, rollout debugging, and billing accuracy for existing apps.Privacy tiers (field map)
/statsactionscountry_code,custom_id,metadata,install_source,defaultChannel,key_id,old_version_name, health/WebView eventsUPDATES_ONLY_STATS_ACTIONS)set,download_complete,set_fail,update_fail,download_faildevice_id,app_id,platform,version_name,version_build,version_os,plugin_version,is_emulator,is_prod; stripscustom_id,metadata,install_source, channel fields,key_id,old_version_name, and does not persist countryTest Plan (AI generated)
bunx vitest run tests/stats-mode.unit.test.tsbun test:backend—tests/stats-mode-ingest.test.ts(API default/update, billingOnly action drop, billingOnly custom_id strip, updatesOnly action drop)apps.stats_modein DBbillingOnly, POSTapp_crashto/stats→200but no stat rowGenerated with AI
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.