Skip to content

feat(stats): accept native observe actions#2392

Open
riderx wants to merge 2 commits into
mainfrom
codex/native-observe-stats-actions
Open

feat(stats): accept native observe actions#2392
riderx wants to merge 2 commits into
mainfrom
codex/native-observe-stats-actions

Conversation

@riderx
Copy link
Copy Markdown
Member

@riderx riderx commented Jun 2, 2026

Summary

  • Adds the missing stats_action enum values for plugin-native observability events.
  • Allows the stats endpoint to receive those actions and exposes matching frontend filter labels.
  • Covers the backend/frontend action-list contract in the existing unit test.

Motivation

  • The Capacitor updater plugin is adding native launch, WebView load, disk-space, and other existing-but-rejected report actions.
  • Capgo needs to accept these events now so a native-app-focused dashboard can be built later on top of real data.

Business Impact

  • Improves Capgo observability data coverage for native app health without changing dashboard UX yet.
  • Reduces dropped plugin stats for failure modes that help users diagnose bad launches, WebView load issues, and update download failures.

Test plan

  • bun lint
  • bun lint:backend
  • bun typecheck
  • bunx vitest run tests/stats-actions.unit.test.ts tests/i18n-fallback.unit.test.ts

Screenshots

  • Not applicable; this PR is backend/action-label plumbing for later dashboard work.

Checklist

  • My code follows the code style of this project and passes bun run lint:backend && bun run lint.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • My change has adequate E2E test coverage.
  • I have tested my code manually, and I have provided steps how to reproduce my tests

AI-generated content: This PR body and implementation were prepared with AI assistance and verified locally before submission.

Summary by CodeRabbit

  • New Features
    • Enhanced app diagnostics with monitoring for app launch states, download completion failures, and storage validation.
    • Extended error tracking for security checksums and network rate limits.
    • Added support for WebView page load event monitoring to improve application performance visibility.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

Warning

Review limit reached

@riderx, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 8 minutes and 34 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e64474ed-974b-4c4f-9d4b-6e9be790177e

📥 Commits

Reviewing files that changed from the base of the PR and between 6677feb and f178e11.

📒 Files selected for processing (1)
  • .sqlfluff
📝 Walkthrough

Walkthrough

Extends the stats action enum across the database schema, backend allowlist, frontend type definitions, and UI wiring to track new app launch lifecycle events, WebView page load events, and error states such as download failures and disk space constraints.

Changes

Stats Action Extension

Layer / File(s) Summary
Database schema and backend allowlist
supabase/migrations/20260602162108_native_observe_stats_actions.sql, supabase/functions/_backend/plugins/stats_actions.ts
Database migration adds 11 new stats_action enum values. Backend allowlist constant is updated to permit these new actions: app launch (start, ready, timeout), download/manifest failures, checksum verification, disk space errors, WebView lifecycle events, and rate-limit/next-selection states.
Backend type definitions
supabase/functions/_backend/utils/supabase.types.ts
Stats_action enum union and Constants array are extended with new action string literals mirroring the database schema additions for type safety in backend code.
Frontend type definitions
src/types/supabase.types.ts
Stats_action enum union and Constants array are updated to match backend types, ensuring frontend code recognizes and validates the same new action values.
Frontend action mappings and internationalization
src/services/statsActions.ts, messages/en.json
StatsActionFilters object gains new action-to-filter mappings for each new action type. Corresponding i18n message keys are added to messages/en.json for UI display of these lifecycle, error, and operational states.
Test coverage
tests/stats-actions.unit.test.ts
HEALTH_STATS_ACTIONS fixture is expanded to include app launch actions and WebView events, validating new actions against backend allowlist and frontend filter mappings.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Cap-go/capgo#2096: Both PRs extend the stats-action filter catalog in src/services/statsActions.ts and update the unit-test fixture to cover expanded health and WebView actions.
  • Cap-go/capgo#2087: Both PRs extend the backend stats_action allowlist and enum typings (ALLOWED_STATS_ACTIONS, stats_action in Supabase types) with new app and WebView health actions following the same pattern.

Suggested labels

codex

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding support for native observe actions to the stats functionality.
Description check ✅ Passed The description is well-structured with all major template sections completed: clear summary, motivation, business impact, comprehensive test plan, and checklist acknowledgment.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

@codspeed-hq
Copy link
Copy Markdown
Contributor

codspeed-hq Bot commented Jun 2, 2026

Merging this PR will not alter performance

✅ 43 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing codex/native-observe-stats-actions (f178e11) with main (9299b08)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@riderx riderx marked this pull request as ready for review June 2, 2026 16:58
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai coderabbitai Bot added the codex label Jun 2, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 2, 2026

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant