diff --git a/.sqlfluff b/.sqlfluff index 1ba88aa997..1b4011bc21 100644 --- a/.sqlfluff +++ b/.sqlfluff @@ -1,2 +1,3 @@ [sqlfluff] +dialect = postgres large_file_skip_byte_limit = 0 diff --git a/messages/en.json b/messages/en.json index 067e337523..1734681edb 100644 --- a/messages/en.json +++ b/messages/en.json @@ -67,6 +67,9 @@ "action-app-initialization-failure": "App startup failed", "action-app-killed-excessive-resource-usage": "Killed for excessive resource usage", "action-app-killed-low-memory": "Killed by low memory", + "action-app-launch-ready": "App launch ready", + "action-app-launch-start": "App launch started", + "action-app-launch-timeout": "App launch timed out", "action-app-memory-warning": "iOS memory warning", "action-app-moved-to-background": "App moved to background", "action-app-moved-to-foreground": "App moved to foreground", @@ -77,6 +80,7 @@ "action-canonical-path-fail": "Canonical path validation failed", "action-channel-misconfigured": "Channel configuration error", "action-checksum-fail": "Checksum validation failed", + "action-checksum-required": "Checksum required", "action-decrypt-fail": "Bundle decryption failed", "action-delete": "Version deletion requested", "action-directory-path-fail": "Directory path validation failed", @@ -112,27 +116,34 @@ "action-download-manifest-start": "Manifest download started", "action-download-zip-complete": "Zip bundle download completed", "action-download-zip-start": "Zip bundle download started", + "action-finish-download-fail": "Finishing download failed", "action-get": "New version sent to device", "action-get-channel": "Channel info retrieved", "action-invalid-ip": "Request from invalid IP", "action-key-mismatch": "Signing key mismatch", + "action-insufficient-disk-space": "Insufficient disk space", "action-low-mem-fail": "Insufficient memory for update", + "action-manifest-path-fail": "Manifest path validation failed", "action-missing-bundle": "Bundle unavailable for version", "action-need-plan-upgrade": "Blocked - plan upgrade required", "action-no-channel-or-override": "No channel or override configured", "action-no-new": "Already has latest version", "action-ping": "Device heartbeat", "action-rate-limited": "Request rate limited", + "action-rate-limit-reached": "Plugin rate limit reached", "action-reset": "Reset to default version", "action-set": "Version installed successfully", "action-set-channel": "Channel set/changed", "action-set-fail": "Version installation failed", + "action-set-next": "Next version selected", "action-uninstall": "Previous version uninstalled", "action-unzip-fail": "Bundle unzip failed", "action-update-fail": "Update process failed", "action-custom-id-blocked": "Custom ID blocked", "action-webview-content-process-terminated": "WebView content process terminated", + "action-webview-dom-content-loaded": "WebView DOM content loaded", "action-webview-javascript-error": "WebView JavaScript error", + "action-webview-page-loaded": "WebView page loaded", "action-webview-render-process-gone": "WebView renderer exited", "action-webview-resource-error": "WebView resource load failed", "action-webview-security-policy-violation": "WebView security policy violation", diff --git a/src/services/statsActions.ts b/src/services/statsActions.ts index 9a91989b42..4a2d926e1a 100644 --- a/src/services/statsActions.ts +++ b/src/services/statsActions.ts @@ -30,9 +30,16 @@ export const statsActionFilters = [ ['action-download-manifest-file-fail', 'download_manifest_file_fail'], ['action-download-manifest-checksum-fail', 'download_manifest_checksum_fail'], ['action-download-manifest-brotli-fail', 'download_manifest_brotli_fail'], + ['action-finish-download-fail', 'finish_download_fail'], + ['action-manifest-path-fail', 'manifest_path_fail'], ['action-decrypt-fail', 'decrypt_fail'], + ['action-checksum-required', 'checksum_required'], + ['action-insufficient-disk-space', 'insufficient_disk_space'], ['action-app-moved-to-foreground', 'app_moved_to_foreground'], ['action-app-moved-to-background', 'app_moved_to_background'], + ['action-app-launch-start', 'app_launch_start'], + ['action-app-launch-ready', 'app_launch_ready'], + ['action-app-launch-timeout', 'app_launch_timeout'], ['action-app-crash', 'app_crash'], ['action-app-crash-native', 'app_crash_native'], ['action-app-anr', 'app_anr'], @@ -47,6 +54,8 @@ export const statsActionFilters = [ ['action-webview-unclean-restart', 'webview_unclean_restart'], ['action-webview-render-process-gone', 'webview_render_process_gone'], ['action-webview-content-process-terminated', 'webview_content_process_terminated'], + ['action-webview-dom-content-loaded', 'webview_dom_content_loaded'], + ['action-webview-page-loaded', 'webview_page_loaded'], ['action-uninstall', 'uninstall'], ['action-need-plan-upgrade', 'needPlanUpgrade'], ['action-missing-bundle', 'missingBundle'], @@ -72,11 +81,13 @@ export const statsActionFilters = [ ['action-set-channel', 'setChannel'], ['action-get-channel', 'getChannel'], ['action-rate-limited', 'rateLimited'], + ['action-rate-limit-reached', 'rate_limit_reached'], ['action-disable-auto-update', 'disableAutoUpdate'], ['action-invalid-ip', 'InvalidIp'], ['action-blocked-by-server-url', 'blocked_by_server_url'], ['action-backend-refusal', 'backend_refusal'], ['action-custom-id-blocked', 'customIdBlocked'], + ['action-set-next', 'set_next'], ] as const export const filterToAction: Record = Object.fromEntries(statsActionFilters) diff --git a/src/types/supabase.types.ts b/src/types/supabase.types.ts index f8dcd735c2..07fb012288 100644 --- a/src/types/supabase.types.ts +++ b/src/types/supabase.types.ts @@ -4729,8 +4729,15 @@ export type Database = { | "download_manifest_file_fail" | "download_manifest_checksum_fail" | "download_manifest_brotli_fail" + | "finish_download_fail" + | "manifest_path_fail" | "backend_refusal" | "download_0" + | "checksum_required" + | "insufficient_disk_space" + | "app_launch_start" + | "app_launch_ready" + | "app_launch_timeout" | "disableProdBuild" | "disableDevice" | "disablePlatformElectron" @@ -4749,6 +4756,10 @@ export type Database = { | "webview_unclean_restart" | "webview_render_process_gone" | "webview_content_process_terminated" + | "webview_dom_content_loaded" + | "webview_page_loaded" + | "rate_limit_reached" + | "set_next" stripe_status: | "created" | "succeeded" @@ -4998,8 +5009,15 @@ export const Constants = { "download_manifest_file_fail", "download_manifest_checksum_fail", "download_manifest_brotli_fail", + "finish_download_fail", + "manifest_path_fail", "backend_refusal", "download_0", + "checksum_required", + "insufficient_disk_space", + "app_launch_start", + "app_launch_ready", + "app_launch_timeout", "disableProdBuild", "disableDevice", "disablePlatformElectron", @@ -5018,6 +5036,10 @@ export const Constants = { "webview_unclean_restart", "webview_render_process_gone", "webview_content_process_terminated", + "webview_dom_content_loaded", + "webview_page_loaded", + "rate_limit_reached", + "set_next", ], stripe_status: [ "created", diff --git a/supabase/functions/_backend/plugins/stats_actions.ts b/supabase/functions/_backend/plugins/stats_actions.ts index 0bc1d24d42..4064b8177c 100644 --- a/supabase/functions/_backend/plugins/stats_actions.ts +++ b/supabase/functions/_backend/plugins/stats_actions.ts @@ -33,9 +33,16 @@ export const ALLOWED_STATS_ACTIONS = [ 'download_manifest_file_fail', 'download_manifest_checksum_fail', 'download_manifest_brotli_fail', + 'finish_download_fail', + 'manifest_path_fail', 'decrypt_fail', + 'checksum_required', + 'insufficient_disk_space', 'app_moved_to_foreground', 'app_moved_to_background', + 'app_launch_start', + 'app_launch_ready', + 'app_launch_timeout', 'uninstall', 'needPlanUpgrade', 'missingBundle', @@ -59,6 +66,7 @@ export const ALLOWED_STATS_ACTIONS = [ 'setChannel', 'getChannel', 'rateLimited', + 'rate_limit_reached', 'disableAutoUpdate', 'keyMismatch', 'InvalidIp', @@ -80,4 +88,7 @@ export const ALLOWED_STATS_ACTIONS = [ 'webview_unclean_restart', 'webview_render_process_gone', 'webview_content_process_terminated', + 'webview_dom_content_loaded', + 'webview_page_loaded', + 'set_next', ] as const satisfies readonly Database['public']['Enums']['stats_action'][] diff --git a/supabase/functions/_backend/utils/supabase.types.ts b/supabase/functions/_backend/utils/supabase.types.ts index f8dcd735c2..07fb012288 100644 --- a/supabase/functions/_backend/utils/supabase.types.ts +++ b/supabase/functions/_backend/utils/supabase.types.ts @@ -4729,8 +4729,15 @@ export type Database = { | "download_manifest_file_fail" | "download_manifest_checksum_fail" | "download_manifest_brotli_fail" + | "finish_download_fail" + | "manifest_path_fail" | "backend_refusal" | "download_0" + | "checksum_required" + | "insufficient_disk_space" + | "app_launch_start" + | "app_launch_ready" + | "app_launch_timeout" | "disableProdBuild" | "disableDevice" | "disablePlatformElectron" @@ -4749,6 +4756,10 @@ export type Database = { | "webview_unclean_restart" | "webview_render_process_gone" | "webview_content_process_terminated" + | "webview_dom_content_loaded" + | "webview_page_loaded" + | "rate_limit_reached" + | "set_next" stripe_status: | "created" | "succeeded" @@ -4998,8 +5009,15 @@ export const Constants = { "download_manifest_file_fail", "download_manifest_checksum_fail", "download_manifest_brotli_fail", + "finish_download_fail", + "manifest_path_fail", "backend_refusal", "download_0", + "checksum_required", + "insufficient_disk_space", + "app_launch_start", + "app_launch_ready", + "app_launch_timeout", "disableProdBuild", "disableDevice", "disablePlatformElectron", @@ -5018,6 +5036,10 @@ export const Constants = { "webview_unclean_restart", "webview_render_process_gone", "webview_content_process_terminated", + "webview_dom_content_loaded", + "webview_page_loaded", + "rate_limit_reached", + "set_next", ], stripe_status: [ "created", diff --git a/supabase/migrations/20260602162108_native_observe_stats_actions.sql b/supabase/migrations/20260602162108_native_observe_stats_actions.sql new file mode 100644 index 0000000000..47c2a2397f --- /dev/null +++ b/supabase/migrations/20260602162108_native_observe_stats_actions.sql @@ -0,0 +1,11 @@ +ALTER TYPE public.stats_action ADD VALUE IF NOT EXISTS 'finish_download_fail'; +ALTER TYPE public.stats_action ADD VALUE IF NOT EXISTS 'checksum_required'; +ALTER TYPE public.stats_action ADD VALUE IF NOT EXISTS 'manifest_path_fail'; +ALTER TYPE public.stats_action ADD VALUE IF NOT EXISTS 'rate_limit_reached'; +ALTER TYPE public.stats_action ADD VALUE IF NOT EXISTS 'set_next'; +ALTER TYPE public.stats_action ADD VALUE IF NOT EXISTS 'insufficient_disk_space'; +ALTER TYPE public.stats_action ADD VALUE IF NOT EXISTS 'app_launch_start'; +ALTER TYPE public.stats_action ADD VALUE IF NOT EXISTS 'app_launch_ready'; +ALTER TYPE public.stats_action ADD VALUE IF NOT EXISTS 'app_launch_timeout'; +ALTER TYPE public.stats_action ADD VALUE IF NOT EXISTS 'webview_dom_content_loaded'; +ALTER TYPE public.stats_action ADD VALUE IF NOT EXISTS 'webview_page_loaded'; diff --git a/tests/stats-actions.unit.test.ts b/tests/stats-actions.unit.test.ts index 8b4fdb6de5..e5ce1d06d3 100644 --- a/tests/stats-actions.unit.test.ts +++ b/tests/stats-actions.unit.test.ts @@ -10,6 +10,9 @@ const HEALTH_STATS_ACTIONS = [ 'app_killed_excessive_resource_usage', 'app_initialization_failure', 'app_memory_warning', + 'app_launch_start', + 'app_launch_ready', + 'app_launch_timeout', 'webview_javascript_error', 'webview_unhandled_rejection', 'webview_resource_error', @@ -17,6 +20,8 @@ const HEALTH_STATS_ACTIONS = [ 'webview_unclean_restart', 'webview_render_process_gone', 'webview_content_process_terminated', + 'webview_dom_content_loaded', + 'webview_page_loaded', ] as const describe('stats action filters', () => {