Skip to content

Develop#57

Closed
ucswift wants to merge 3 commits intomasterfrom
develop
Closed

Develop#57
ucswift wants to merge 3 commits intomasterfrom
develop

Conversation

@ucswift
Copy link
Member

@ucswift ucswift commented Jul 31, 2025

Summary by CodeRabbit

  • New Features

    • Push Notification modal with quick actions (e.g., view call).
    • Offline queue processes unit status, location, and call image uploads when offline.
    • App icon badges (non-production).
    • Aptabase analytics integration.
    • iOS background audio support via system call UI.
  • Improvements

    • Permission-based visibility for creating calls/messages and header menus.
    • PII protection: hides personnel pins/coordinates and contact info when restricted.
    • Enhanced Bluetooth audio: updated device selection UI, indicators, and scanning behavior.
    • Audio runs in background; improved microphone permission handling.
    • Safer Notifications Inbox rendering and interaction.
  • Android

    • Added telecom permissions enabling call features.

@coderabbitai
Copy link

coderabbitai bot commented Aug 19, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The PR replaces PostHog with Aptabase analytics, overhauls BLE from react-native-ble-plx to react-native-ble-manager, adds CallKeep iOS integration, introduces offline queue services, expands config models/endpoints, adds security/PII gates in UI, updates SignalR connection flow, adjusts location/push-notification services, and modifies CI release/versioning.

Changes

Cohort / File(s) Summary
CI & Releases
.github/workflows/react-native-cicd.yml
Computes androidVersionCode from run_number, bumps version to 10.${run_number}, extracts PR release notes, creates Android-only releases with artifacts and notes.
Android Manifest & Telephony
android/app/src/main/AndroidManifest.xml
Adds CALL_PHONE/READ_PHONE_STATE and telecom services (CallKeep). Removes required BLE LE feature.
Config & Models
app.config.ts, src/models/v4/configs/getConfigResultData.ts, src/models/v4/configs/getSystemConfigResult*.ts, src/api/config/index.ts
Sources version/build from package.json; adds app-icon-badge and plugins; expands config with Eventing/Analytics/location fields; adds GetSystemConfig models and API with 1-day cache.
Dependencies & Env
package.json, env.js
Adds Aptabase, CallKeep, NetInfo, app-icon-badge; replaces ble-plx with ble-manager; switches env from PostHog_* to APTABASE_* mappings.
Analytics Migration
src/components/common/aptabase-provider.tsx, src/hooks/use-analytics.ts, src/services/aptabase.service.ts, src/app/_layout.tsx
Introduces Aptabase provider and hook; adds analytics service with retry/disable; wraps app with Aptabase in prod; removes PostHog provider and tests.
BLE Stack Refactor
src/services/bluetooth-audio.service.ts, src/stores/app/bluetooth-audio-store.ts, src/components/bluetooth/bluetooth-audio-modal.tsx, __mocks__/react-native-ble-plx.ts
Migrates to react-native-ble-manager; adds initialize(), event listeners, audio capability detection; updates store types/State enum and UI to lowercase states; removes ble-plx mock.
Bluetooth UI & Settings
src/components/settings/bluetooth-device-selection-bottom-sheet*.test.tsx, src/components/settings/bluetooth-device-selection-bottom-sheet.tsx, src/components/settings/audio-device-selection.tsx, src/components/settings/__tests__/audio-device-selection.test.tsx
Adds translation-rich device selection UI, connection error display, State enum usage, scan lifecycle, and device selection flow; extensive tests.
CallKeep Integration
src/services/callkeep.service.ios.ts, src/services/__tests__/callkeep.service.ios.test.ts, src/services/app-initialization.service.ts, src/services/__tests__/app-initialization.service.test.ts, src/features/livekit-call/store/useLiveKitCallStore.ts
Adds iOS CallKeep service and app initializer; LiveKit store integrates CallKeep mute/call lifecycle; comprehensive tests.
LiveKit Store & UI
src/stores/app/livekit-store.ts, src/components/livekit/livekit-bottom-sheet.tsx, src/components/livekit/__tests__/livekit-bottom-sheet.test.tsx, src/features/livekit-call/store/__tests__/useLiveKitCallStore.test.ts
Switches to expo-audio permissions, structured logging; removes isMicrophoneEnabled/toggle; adds analytics event on sheet open and safer permission handling; tests updated/added.
Security/Permissions Gating
src/app/(app)/home/calls.tsx, src/app/(app)/messages.tsx, src/app/call/[id].tsx, src/components/calls/call-detail-menu.tsx, src/components/calls/__tests__/*, src/app/(app)/**/__tests__/*
Gates FABs/menus and zero-state buttons by security store permissions; updates/introduces tests validating visibility and flows.
PII Protections (Maps/Personnel)
src/components/maps/map-pins.tsx, src/components/maps/pin-detail-modal.tsx, src/components/personnel/personnel-card.tsx, src/components/personnel/personnel-details-sheet.tsx, src/components/**/__tests__/*pii*.test.tsx
Hides personnel pins/coordinates and contact info when canUserViewPII is false; tests added.
Offline Queue & Status
src/models/offline-queue/queued-event.ts, src/services/offline-queue-processor.ts, src/services/offline-event-manager.service.ts, src/services/offline-queue.service.ts, src/components/status/store.ts, src/app/(app)/_layout.tsx
Adds offline queue processor/manager/services and queued event types; status store saves online or queues offline; initializes offline queue on app start; tests for queue processing and GPS payloads.
SignalR Lifecycle & Service
src/services/signalr.service.ts, src/hooks/use-signalr-lifecycle.ts, src/hooks/use-status-signalr-updates.ts, src/hooks/__tests__/*signalr*.test*
Adds eventing-URL connect API with geolocation token-in-URL, reconnection via stored configs; debounced lifecycle handlers; new status updates hook; extensive tests.
Location Service Changes
src/services/location.ts, src/services/__tests__/location.test.ts
Removes realtime geolocation setting; switches to unit-based location updates (setUnitLocation); logging updates; tests adjusted.
Push Notifications & Modal
src/services/push-notification.ts, src/components/push-notification/push-notification-modal.tsx, src/components/push-notification/__tests__/*, src/app/_layout.tsx
New modal component; service now registers unit devices and shows modal on eventCode; adds provider mounting; tests for modal and service.
Notifications Inbox
src/components/notifications/NotificationInbox.tsx, src/components/notifications/__tests__/NotificationInbox*.test.tsx
Guards rendering on required config; adjusts z-index/pointer events; refactors tests, adds selection/bulk-delete flows.
Messages Defaults
src/stores/messages/store.ts, src/stores/messages/__tests__/store.test.ts
Changes default filter to 'inbox'; tests updated.
Common UI Tweaks
src/components/common/loading.tsx, src/components/common/zero-state.tsx, src/components/settings/login-info-bottom-sheet.tsx, src/components/settings/server-url-bottom-sheet.tsx, src/components/settings/item.tsx, src/components/notifications/NotificationButton.tsx, src/components/sidebar/side-menu.tsx
Removes Loading testID prop; adds layout props to ZeroState; wraps login form in KeyboardAvoidingView; makes server URL sheet scrollable; simplifies Item icon color; tailwind color for BellIcon; removes toggleMicrophone usage.
Docs Removal
docs/bluetooth-audio-integration.md, docs/bluetooth-enhancements.md
Deletes Bluetooth-related docs.
Removed Legacy BLE Tests
src/services/__tests__/bluetooth-audio-hys.test.ts, src/components/common/__tests__/posthog-provider.test.tsx, src/components/notifications/__tests__/NotificationInbox.simple.test.tsx
Removes obsolete tests tied to old BLE/PostHog flows.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant OS as OS Notifications
  participant App as PushNotificationService
  participant Store as PushNotificationModalStore
  participant UI as PushNotificationModal
  participant Nav as Router

  OS->>App: Notification received (data)
  App->>App: Validate eventCode
  App-->>Store: showNotificationModal({type,id,title,body,eventCode,data})
  Store-->>UI: isOpen=true, payload
  User->>UI: Dismiss
  UI-->>Store: hideNotificationModal()
  alt Type = call and id present
    User->>UI: View Call
    UI-->>Nav: push(/call/{id})
    UI-->>Store: hideNotificationModal()
  end
Loading
sequenceDiagram
  autonumber
  participant App as App Startup
  participant OQS as OfflineQueueService
  participant Proc as OfflineQueueProcessor
  participant Store as OfflineQueueStore
  App->>OQS: initialize()
  OQS->>Store: initializeNetworkListener()
  OQS->>Proc: startProcessing()
  loop every 10s
    Proc->>Store: getPendingEvents()
    alt Has events and network
      Proc->>Proc: process next (<=3 concurrent)
      Proc->>Store: update status (PROCESSING/COMPLETED/FAILED)
    else No work or offline
      Proc-->>Proc: skip cycle
    end
  end
Loading
sequenceDiagram
  autonumber
  participant Client as SignalRService
  participant Auth as AuthStore
  participant Hub as HubConnection
  Client->>Client: connectToHubWithEventingUrl(config)
  Client->>Auth: get access token / refresh if needed
  Client->>Hub: build withUrl (eventingUrl + hubName)
  Hub-->>Client: start()
  Note over Hub,Client: onclose -> reconnect after delay
  Hub-->>Client: close event
  Client->>Auth: refreshAccessToken()
  Client->>Client: reconnect using stored hubConfig
Loading
sequenceDiagram
  autonumber
  participant App as AppInitializationService
  participant CK as CallKeepService (iOS)
  participant UI as Root Layout
  UI->>App: initialize()
  App->>CK: setup({appName, limits,...}) (iOS only)
  CK-->>App: ready
  App-->>UI: initialized
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120+ minutes

Poem

I thump my paw—release is near,
New calls ring clear, with CallKeep cheer.
BLE hops anew, a nimble dance,
Offline queues await their chance.
Aptabase stars now light the sky—
A rabbit ships, with twinkling eye.
Hop, test, merge—away we fly! 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch develop

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@ucswift ucswift closed this Aug 19, 2025
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