From af964eafad8b683ae88f424e4ad80bb3317633b7 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Tue, 7 Jul 2026 17:00:31 -0300 Subject: [PATCH 1/7] chore: stub expo-av to unblock build on Expo SDK 55 --- app/containers/AudioPlayer/index.tsx | 2 +- .../components/Buttons/MicOrSendButton.tsx | 2 +- .../components/RecordAudio/Duration.tsx | 2 +- .../components/RecordAudio/RecordAudio.tsx | 2 +- .../VoipCallLifecycle.integration.test.tsx | 2 +- app/containers/Ringer/index.tsx | 2 +- app/lib/constants/audio.ts | 9 +- app/lib/methods/AudioManager.ts | 2 +- app/lib/methods/helpers/expoAvShim.ts | 222 ++++++++++++++++++ .../services/voip/playCallEndedSound.test.ts | 4 +- app/lib/services/voip/playCallEndedSound.ts | 2 +- app/views/AttachmentView.test.tsx | 2 +- app/views/AttachmentView.tsx | 2 +- .../components/Dialpad/DialpadContext.tsx | 2 +- app/views/CallView/index.test.tsx | 2 +- app/views/CallView/index.tsx | 4 +- app/views/ShareView/Preview.tsx | 2 +- jest.setup.js | 2 +- package.json | 1 - pnpm-lock.yaml | 20 -- 20 files changed, 247 insertions(+), 41 deletions(-) create mode 100644 app/lib/methods/helpers/expoAvShim.ts diff --git a/app/containers/AudioPlayer/index.tsx b/app/containers/AudioPlayer/index.tsx index 02fa5c60cc6..60e91407c87 100644 --- a/app/containers/AudioPlayer/index.tsx +++ b/app/containers/AudioPlayer/index.tsx @@ -1,6 +1,6 @@ import { useEffect, useRef, useState } from 'react'; import { InteractionManager, View } from 'react-native'; -import { type AVPlaybackStatus } from 'expo-av'; +import { type AVPlaybackStatus } from '../../lib/methods/helpers/expoAvShim'; import { activateKeepAwake, deactivateKeepAwake } from 'expo-keep-awake'; import { useSharedValue } from 'react-native-reanimated'; import { useNavigation } from '@react-navigation/native'; diff --git a/app/containers/MessageComposer/components/Buttons/MicOrSendButton.tsx b/app/containers/MessageComposer/components/Buttons/MicOrSendButton.tsx index c5a06567f94..51054fa0779 100644 --- a/app/containers/MessageComposer/components/Buttons/MicOrSendButton.tsx +++ b/app/containers/MessageComposer/components/Buttons/MicOrSendButton.tsx @@ -1,4 +1,4 @@ -import { Audio } from 'expo-av'; +import { Audio } from '../../../../lib/methods/helpers/expoAvShim'; import { useContext, type ReactElement } from 'react'; import { Alert } from 'react-native'; import { PermissionStatus } from 'expo-camera'; diff --git a/app/containers/MessageComposer/components/RecordAudio/Duration.tsx b/app/containers/MessageComposer/components/RecordAudio/Duration.tsx index ee32696fa73..35534b861ed 100644 --- a/app/containers/MessageComposer/components/RecordAudio/Duration.tsx +++ b/app/containers/MessageComposer/components/RecordAudio/Duration.tsx @@ -1,6 +1,6 @@ import { forwardRef, useImperativeHandle, useState } from 'react'; import { type FontVariant, Text } from 'react-native'; -import { type Audio } from 'expo-av'; +import { type Audio } from '../../../../lib/methods/helpers/expoAvShim'; import sharedStyles from '../../../../views/Styles'; import { useTheme } from '../../../../theme'; diff --git a/app/containers/MessageComposer/components/RecordAudio/RecordAudio.tsx b/app/containers/MessageComposer/components/RecordAudio/RecordAudio.tsx index 296505efd85..2b6512c64a9 100644 --- a/app/containers/MessageComposer/components/RecordAudio/RecordAudio.tsx +++ b/app/containers/MessageComposer/components/RecordAudio/RecordAudio.tsx @@ -1,6 +1,6 @@ import { View, Text } from 'react-native'; import { useEffect, useRef, useState, type ReactElement } from 'react'; -import { Audio } from 'expo-av'; +import { Audio } from '../../../../lib/methods/helpers/expoAvShim'; import { getInfoAsync } from 'expo-file-system/legacy'; import { useKeepAwake } from 'expo-keep-awake'; import { shallowEqual } from 'react-redux'; diff --git a/app/containers/NewMediaCall/VoipCallLifecycle.integration.test.tsx b/app/containers/NewMediaCall/VoipCallLifecycle.integration.test.tsx index 37a40761bbe..bb1e7af72d0 100644 --- a/app/containers/NewMediaCall/VoipCallLifecycle.integration.test.tsx +++ b/app/containers/NewMediaCall/VoipCallLifecycle.integration.test.tsx @@ -157,7 +157,7 @@ jest.mock('../../lib/services/voip/getPeerAutocompleteOptions', () => ({ jest.mock('../../lib/services/voip/navigateToCallRoom', () => ({ navigateToCallRoom: jest.fn().mockResolvedValue(undefined) })); -// playCallEndedSound → expo-av → Audio.Sound constructor not present in this test boundary. +// playCallEndedSound → Audio.Sound constructor from the expo-av shim not present in this test boundary. jest.mock('../../lib/services/voip/playCallEndedSound', () => ({ playCallEndedSound: jest.fn() })); diff --git a/app/containers/Ringer/index.tsx b/app/containers/Ringer/index.tsx index 19dad9435cd..b1fa7c780a5 100644 --- a/app/containers/Ringer/index.tsx +++ b/app/containers/Ringer/index.tsx @@ -1,4 +1,4 @@ -import { Audio } from 'expo-av'; +import { Audio } from '../../lib/methods/helpers/expoAvShim'; import { useEffect, useRef, memo } from 'react'; export enum ERingerSounds { diff --git a/app/lib/constants/audio.ts b/app/lib/constants/audio.ts index f0c506c34de..dd6cb6c194d 100644 --- a/app/lib/constants/audio.ts +++ b/app/lib/constants/audio.ts @@ -1,5 +1,10 @@ -import { Audio, type AudioMode, InterruptionModeAndroid, InterruptionModeIOS } from 'expo-av'; -import { type RecordingOptions } from 'expo-av/build/Audio'; +import { + Audio, + type AudioMode, + InterruptionModeAndroid, + InterruptionModeIOS, + type RecordingOptions +} from '../methods/helpers/expoAvShim'; export const RECORDING_EXTENSION = '.aac'; export const RECORDING_SETTINGS: RecordingOptions = { diff --git a/app/lib/methods/AudioManager.ts b/app/lib/methods/AudioManager.ts index ee4b9bec978..f02e79a9cf2 100644 --- a/app/lib/methods/AudioManager.ts +++ b/app/lib/methods/AudioManager.ts @@ -1,4 +1,4 @@ -import { type AVPlaybackStatus, Audio } from 'expo-av'; +import { type AVPlaybackStatus, Audio } from './helpers/expoAvShim'; import { Q } from '@nozbe/watermelondb'; import dayjs from '../dayjs'; diff --git a/app/lib/methods/helpers/expoAvShim.ts b/app/lib/methods/helpers/expoAvShim.ts new file mode 100644 index 00000000000..7ed385739ea --- /dev/null +++ b/app/lib/methods/helpers/expoAvShim.ts @@ -0,0 +1,222 @@ +import { Component } from 'react'; + +/** + * Dark stub for `expo-av`, dropped in Expo SDK 55. Reproduces the subset of its + * surface this app uses as typed no-ops: audio/video playback and recording + * are intentionally disabled, not migrated to expo-audio/expo-video. + */ + +export type AVPlaybackStatus = + | { isLoaded: false; error?: string } + | { + isLoaded: true; + isPlaying: boolean; + didJustFinish: boolean; + durationMillis?: number; + positionMillis: number; + rate: number; + shouldCorrectPitch: boolean; + volume: number; + isMuted: boolean; + isLooping: boolean; + }; + +export enum InterruptionModeIOS { + MixWithOthers = 0, + DoNotMix = 1, + DuckOthers = 2 +} + +export enum InterruptionModeAndroid { + DoNotMix = 1, + DuckOthers = 2 +} + +export interface AudioMode { + allowsRecordingIOS: boolean; + interruptionModeIOS: InterruptionModeIOS; + playsInSilentModeIOS: boolean; + staysActiveInBackground: boolean; + interruptionModeAndroid: InterruptionModeAndroid; + shouldDuckAndroid: boolean; + playThroughEarpieceAndroid: boolean; +} + +export interface RecordingOptionsAndroid { + extension: string; + outputFormat: number; + audioEncoder: number; + sampleRate?: number; + numberOfChannels?: number; + bitRate?: number; +} + +export interface RecordingOptionsIOS { + extension: string; + outputFormat?: string | number; + audioQuality: number; + sampleRate: number; + numberOfChannels: number; + bitRate: number; +} + +export interface RecordingOptions { + isMeteringEnabled?: boolean; + keepAudioActiveHint?: boolean; + android: RecordingOptionsAndroid; + ios: RecordingOptionsIOS; + web: Record; +} + +export enum ResizeMode { + CONTAIN = 'contain', + COVER = 'cover', + STRETCH = 'stretch' +} + +const RESOLVED_PLAYBACK_STATUS: AVPlaybackStatus = { + isLoaded: true, + isPlaying: false, + didJustFinish: false, + positionMillis: 0, + rate: 1, + shouldCorrectPitch: false, + volume: 1, + isMuted: false, + isLooping: false +}; + +const NOOP_PERMISSION_RESPONSE = { granted: false, status: 'undetermined', canAskAgain: true }; + +// eslint-disable-next-line @typescript-eslint/no-namespace +export namespace Audio { + export class Sound { + static async createAsync(_source: unknown, _initialStatus?: unknown): Promise<{ sound: Sound; status: AVPlaybackStatus }> { + return { sound: new Sound(), status: RESOLVED_PLAYBACK_STATUS }; + } + + async playAsync(): Promise { + return RESOLVED_PLAYBACK_STATUS; + } + + async pauseAsync(): Promise { + return RESOLVED_PLAYBACK_STATUS; + } + + async stopAsync(): Promise { + return RESOLVED_PLAYBACK_STATUS; + } + + async unloadAsync(): Promise { + return RESOLVED_PLAYBACK_STATUS; + } + + async loadAsync(_source: unknown): Promise { + return RESOLVED_PLAYBACK_STATUS; + } + + async setPositionAsync(_millis: number): Promise { + return RESOLVED_PLAYBACK_STATUS; + } + + async setRateAsync(_rate: number, _shouldCorrectPitch?: boolean): Promise { + return RESOLVED_PLAYBACK_STATUS; + } + + async setIsLoopingAsync(_isLooping: boolean): Promise { + return RESOLVED_PLAYBACK_STATUS; + } + + setOnPlaybackStatusUpdate(_callback: ((status: AVPlaybackStatus) => void) | null): void {} + } + + export interface RecordingStatus { + canRecord: boolean; + isRecording: boolean; + isDoneRecording: boolean; + durationMillis: number; + metering?: number; + uri?: string | null; + } + + export class Recording { + async prepareToRecordAsync(_options?: RecordingOptions): Promise { + return { canRecord: true, isRecording: false, isDoneRecording: false, durationMillis: 0 }; + } + + setOnRecordingStatusUpdate(_callback: ((status: RecordingStatus) => void) | null): void {} + + async startAsync(): Promise { + return { canRecord: true, isRecording: true, isDoneRecording: false, durationMillis: 0 }; + } + + async stopAndUnloadAsync(): Promise { + return { canRecord: false, isRecording: false, isDoneRecording: true, durationMillis: 0 }; + } + + getURI(): string | null { + return null; + } + } + + export const setAudioModeAsync = async (_mode: Partial): Promise => {}; + + export const AndroidOutputFormat = { AAC_ADTS: 6 } as const; + export const AndroidAudioEncoder = { AAC: 3 } as const; + export const IOSAudioQuality = { MEDIUM: 0x40 } as const; + export const IOSOutputFormat = { MPEG4AAC: 'aac ' } as const; + + export const RecordingOptionsPresets: Record = { + LOW_QUALITY: { + android: { + extension: '.3gp', + outputFormat: AndroidOutputFormat.AAC_ADTS, + audioEncoder: AndroidAudioEncoder.AAC, + sampleRate: 44100, + numberOfChannels: 2, + bitRate: 128000 + }, + ios: { + extension: '.caf', + audioQuality: IOSAudioQuality.MEDIUM, + outputFormat: IOSOutputFormat.MPEG4AAC, + sampleRate: 44100, + numberOfChannels: 2, + bitRate: 128000 + }, + web: {} + } + }; + + export const requestPermissionsAsync = async (): Promise<{ granted: boolean; status: string; canAskAgain: boolean }> => ({ + ...NOOP_PERMISSION_RESPONSE + }); + + export const getPermissionsAsync = async (): Promise<{ granted: boolean; status: string; canAskAgain: boolean }> => ({ + ...NOOP_PERMISSION_RESPONSE + }); +} + +interface VideoProps { + source?: unknown; + rate?: number; + volume?: number; + isMuted?: boolean; + resizeMode?: ResizeMode; + shouldPlay?: boolean; + isLooping?: boolean; + style?: unknown; + useNativeControls?: boolean; + onLoad?: (status: AVPlaybackStatus) => void; + onError?: (error: string) => void; +} + +export class Video extends Component { + async stopAsync(): Promise { + return RESOLVED_PLAYBACK_STATUS; + } + + render() { + return null; + } +} diff --git a/app/lib/services/voip/playCallEndedSound.test.ts b/app/lib/services/voip/playCallEndedSound.test.ts index 8b06efb3ab7..a4446c32397 100644 --- a/app/lib/services/voip/playCallEndedSound.test.ts +++ b/app/lib/services/voip/playCallEndedSound.test.ts @@ -6,7 +6,7 @@ jest.mock('../../methods/helpers/log', () => ({ default: (...args: unknown[]) => mockLog(...args) })); -// Mock expo-av at the test boundary, matching the style used in the VoIP services directory. +// Mock the expo-av shim at the test boundary, matching the style used in the VoIP services directory. const mockLoadAsync = jest.fn(() => Promise.resolve()); const mockPlayAsync = jest.fn(() => Promise.resolve()); const mockUnloadAsync = jest.fn(() => Promise.resolve()); @@ -24,7 +24,7 @@ const mockSoundInstance = { setOnPlaybackStatusUpdate: mockSetOnPlaybackStatusUpdate }; -jest.mock('expo-av', () => ({ +jest.mock('../../methods/helpers/expoAvShim', () => ({ Audio: { Sound: jest.fn(() => mockSoundInstance) } diff --git a/app/lib/services/voip/playCallEndedSound.ts b/app/lib/services/voip/playCallEndedSound.ts index 7c877b4dd43..7ed234231fc 100644 --- a/app/lib/services/voip/playCallEndedSound.ts +++ b/app/lib/services/voip/playCallEndedSound.ts @@ -1,4 +1,4 @@ -import { Audio } from 'expo-av'; +import { Audio } from '../../methods/helpers/expoAvShim'; import log from '../../methods/helpers/log'; diff --git a/app/views/AttachmentView.test.tsx b/app/views/AttachmentView.test.tsx index 0376332a134..5ecb14adeb2 100644 --- a/app/views/AttachmentView.test.tsx +++ b/app/views/AttachmentView.test.tsx @@ -18,7 +18,7 @@ jest.mock('react-native-safe-area-context', () => ({ useSafeAreaInsets: () => ({ top: 0, bottom: 0, left: 0, right: 0 }) })); -jest.mock('expo-av', () => ({ +jest.mock('../lib/methods/helpers/expoAvShim', () => ({ ResizeMode: { CONTAIN: 'contain' }, Video: () => null })); diff --git a/app/views/AttachmentView.tsx b/app/views/AttachmentView.tsx index 322b659eada..731542e8e9f 100644 --- a/app/views/AttachmentView.tsx +++ b/app/views/AttachmentView.tsx @@ -1,6 +1,6 @@ import { CameraRoll } from '@react-native-camera-roll/camera-roll'; import { useHeaderHeight } from '@react-navigation/elements'; -import { ResizeMode, Video } from 'expo-av'; +import { ResizeMode, Video } from '../lib/methods/helpers/expoAvShim'; import { useCallback, useLayoutEffect, useRef, useState, type Dispatch, type SetStateAction, type ReactElement } from 'react'; import { PermissionsAndroid, useWindowDimensions, View } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; diff --git a/app/views/CallView/components/Dialpad/DialpadContext.tsx b/app/views/CallView/components/Dialpad/DialpadContext.tsx index 0bbaf08deee..8debd4c8123 100644 --- a/app/views/CallView/components/Dialpad/DialpadContext.tsx +++ b/app/views/CallView/components/Dialpad/DialpadContext.tsx @@ -1,5 +1,5 @@ import { createContext, type ReactNode, useContext, useEffect, useRef } from 'react'; -import { Audio, InterruptionModeAndroid, InterruptionModeIOS } from 'expo-av'; +import { Audio, InterruptionModeAndroid, InterruptionModeIOS } from '../../../../lib/methods/helpers/expoAvShim'; const DTMF_ASSETS: Record> = { '0': require('../../../../containers/Ringer/dtmf/digit-0.mp3'), diff --git a/app/views/CallView/index.test.tsx b/app/views/CallView/index.test.tsx index 70e8fec9a7a..f716f548e92 100644 --- a/app/views/CallView/index.test.tsx +++ b/app/views/CallView/index.test.tsx @@ -651,7 +651,7 @@ describe('CallView outgoing ringback', () => { (Platform as { OS: string }).OS = 'ios'; }); - it('does not call native ringback (expo-av Ringer handles iOS)', () => { + it('does not call native ringback (Ringer component handles iOS)', () => { setStoreState({ callState: 'ringing', direction: 'outgoing' }); render( diff --git a/app/views/CallView/index.tsx b/app/views/CallView/index.tsx index 3254ee32705..259dc0f5de3 100644 --- a/app/views/CallView/index.tsx +++ b/app/views/CallView/index.tsx @@ -1,5 +1,5 @@ import { type ReactElement, useEffect } from 'react'; -import { Audio, InterruptionModeIOS } from 'expo-av'; +import { Audio, InterruptionModeIOS } from '../../lib/methods/helpers/expoAvShim'; import { useCallStore } from '../../lib/services/voip/useCallStore'; import CallerInfo from './components/CallerInfo'; @@ -51,7 +51,7 @@ const CallView = (): ReactElement | null => { const showRingback = callState === 'ringing' && direction === 'outgoing'; // Android plays ringback natively (USAGE_VOICE_COMMUNICATION) so it follows the active comm - // device and toggleSpeaker actually reroutes it. iOS keeps expo-av Ringer (CallKit-managed). + // device and toggleSpeaker actually reroutes it. iOS keeps the Ringer component (CallKit-managed). useEffect(() => { if (isIOS || !showRingback) return; NativeVoipModule.startRingback().catch(error => { diff --git a/app/views/ShareView/Preview.tsx b/app/views/ShareView/Preview.tsx index 9d75cd8070d..d4077f00abe 100644 --- a/app/views/ShareView/Preview.tsx +++ b/app/views/ShareView/Preview.tsx @@ -1,5 +1,5 @@ import { memo, useState } from 'react'; -import { Video, ResizeMode } from 'expo-av'; +import { Video, ResizeMode } from '../../lib/methods/helpers/expoAvShim'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { ScrollView, StyleSheet, Text, useWindowDimensions, View } from 'react-native'; import prettyBytes from 'pretty-bytes'; diff --git a/jest.setup.js b/jest.setup.js index 6badf7a46a6..1dc64e4b673 100644 --- a/jest.setup.js +++ b/jest.setup.js @@ -91,7 +91,7 @@ jest.mock('expo-font', () => ({ __esModule: true })); -jest.mock('expo-av', () => { +jest.mock('./app/lib/methods/helpers/expoAvShim', () => { const InterruptionModeAndroid = { DoNotMix: 1, DuckOthers: 2 diff --git a/package.json b/package.json index 7e2b21c1216..6755fc8ebef 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,6 @@ "eslint-import-resolver-typescript": "^4.4.4", "expo": "^55.0.0", "expo-apple-authentication": "~55.0.14", - "expo-av": "~16.0.8", "expo-camera": "~55.0.20", "expo-device": "^55.0.18", "expo-document-picker": "~55.0.14", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 45e8ef26290..4ae95335158 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -123,9 +123,6 @@ importers: expo-apple-authentication: specifier: ~55.0.14 version: 55.0.14(expo@55.0.27)(react-native@0.83.10(@babel/core@7.29.7)(@react-native-community/cli@20.0.0(typescript@5.9.3))(@react-native/metro-config@0.83.10(@babel/core@7.29.7))(@types/react@19.2.17)(react@19.2.7)) - expo-av: - specifier: ~16.0.8 - version: 16.0.8(expo@55.0.27)(react-native@0.83.10(@babel/core@7.29.7)(@react-native-community/cli@20.0.0(typescript@5.9.3))(@react-native/metro-config@0.83.10(@babel/core@7.29.7))(@types/react@19.2.17)(react@19.2.7))(react@19.2.7) expo-camera: specifier: ~55.0.20 version: 55.0.20(@types/emscripten@1.41.5)(expo@55.0.27)(react-native@0.83.10(@babel/core@7.29.7)(@react-native-community/cli@20.0.0(typescript@5.9.3))(@react-native/metro-config@0.83.10(@babel/core@7.29.7))(@types/react@19.2.17)(react@19.2.7))(react@19.2.7) @@ -4560,17 +4557,6 @@ packages: react: '*' react-native: '*' - expo-av@16.0.8: - resolution: {integrity: sha512-cmVPftGR/ca7XBgs7R6ky36lF3OC0/MM/lpgX/yXqfv0jASTsh7AYX9JxHCwFmF+Z6JEB1vne9FDx4GiLcGreQ==} - peerDependencies: - expo: '*' - react: '*' - react-native: '*' - react-native-web: '*' - peerDependenciesMeta: - react-native-web: - optional: true - expo-camera@55.0.20: resolution: {integrity: sha512-q4AxUiQo39Ra9v7SD92+vUa7rfXIqqc7ECjZV2Abnvrome8nwpTTWLa0/GQWf6EBbXdS+IED1dlpikV/KQ1qYQ==} peerDependencies: @@ -13247,12 +13233,6 @@ snapshots: - supports-color - typescript - expo-av@16.0.8(expo@55.0.27)(react-native@0.83.10(@babel/core@7.29.7)(@react-native-community/cli@20.0.0(typescript@5.9.3))(@react-native/metro-config@0.83.10(@babel/core@7.29.7))(@types/react@19.2.17)(react@19.2.7))(react@19.2.7): - dependencies: - expo: 55.0.27(@babel/core@7.29.7)(@expo/dom-webview@55.0.6)(react-dom@19.2.7(react@19.2.7))(react-native-webview@13.16.0(react-native@0.83.10(@babel/core@7.29.7)(@react-native-community/cli@20.0.0(typescript@5.9.3))(@react-native/metro-config@0.83.10(@babel/core@7.29.7))(@types/react@19.2.17)(react@19.2.7))(react@19.2.7))(react-native-worklets@0.7.4(@babel/core@7.29.7)(react-native@0.83.10(@babel/core@7.29.7)(@react-native-community/cli@20.0.0(typescript@5.9.3))(@react-native/metro-config@0.83.10(@babel/core@7.29.7))(@types/react@19.2.17)(react@19.2.7))(react@19.2.7))(react-native@0.83.10(@babel/core@7.29.7)(@react-native-community/cli@20.0.0(typescript@5.9.3))(@react-native/metro-config@0.83.10(@babel/core@7.29.7))(@types/react@19.2.17)(react@19.2.7))(react@19.2.7)(typescript@5.9.3) - react: 19.2.7 - react-native: 0.83.10(@babel/core@7.29.7)(@react-native-community/cli@20.0.0(typescript@5.9.3))(@react-native/metro-config@0.83.10(@babel/core@7.29.7))(@types/react@19.2.17)(react@19.2.7) - expo-camera@55.0.20(@types/emscripten@1.41.5)(expo@55.0.27)(react-native@0.83.10(@babel/core@7.29.7)(@react-native-community/cli@20.0.0(typescript@5.9.3))(@react-native/metro-config@0.83.10(@babel/core@7.29.7))(@types/react@19.2.17)(react@19.2.7))(react@19.2.7): dependencies: barcode-detector: 3.2.0(@types/emscripten@1.41.5) From 927f8d367ce20eab65934c2b0d95a9a883e62581 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Wed, 8 Jul 2026 09:52:21 -0300 Subject: [PATCH 2/7] chore: regenerate expo-font patch for 55.0.8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Filename was stale (14.0.10 → resolved 55.0.8, Expo SDK 55 renumber). Hunks are byte-identical across versions (native Android font-loader fallback); rename resolves the patch-package version-mismatch warning. --- patches/{expo-font+14.0.10.patch => expo-font+55.0.8.patch} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename patches/{expo-font+14.0.10.patch => expo-font+55.0.8.patch} (100%) diff --git a/patches/expo-font+14.0.10.patch b/patches/expo-font+55.0.8.patch similarity index 100% rename from patches/expo-font+14.0.10.patch rename to patches/expo-font+55.0.8.patch From 330999ba75d33e566d4edb6f313caaf4a0ef59ff Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Wed, 8 Jul 2026 09:54:24 -0300 Subject: [PATCH 3/7] chore: regenerate gesture-handler patch for 2.30.1 Filename was stale (2.28.0 -> resolved 2.30.1). Added iOS keyboard-focus methods on RNGestureHandlerButton are unchanged, but the insertion point shifted (hunk @@ -89 -> @@ -82), so hunks were regenerated against 2.30.1 to be exact rather than fuzzy-applied. --- ...2.28.0.patch => react-native-gesture-handler+2.30.1.patch} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename patches/{react-native-gesture-handler+2.28.0.patch => react-native-gesture-handler+2.30.1.patch} (97%) diff --git a/patches/react-native-gesture-handler+2.28.0.patch b/patches/react-native-gesture-handler+2.30.1.patch similarity index 97% rename from patches/react-native-gesture-handler+2.28.0.patch rename to patches/react-native-gesture-handler+2.30.1.patch index 309449cc7c5..fb130954d20 100644 --- a/patches/react-native-gesture-handler+2.28.0.patch +++ b/patches/react-native-gesture-handler+2.30.1.patch @@ -1,8 +1,8 @@ diff --git a/node_modules/react-native-gesture-handler/apple/RNGestureHandlerButton.mm b/node_modules/react-native-gesture-handler/apple/RNGestureHandlerButton.mm -index 2296c39..0a872ba 100644 +index c9f8067..290f404 100644 --- a/node_modules/react-native-gesture-handler/apple/RNGestureHandlerButton.mm +++ b/node_modules/react-native-gesture-handler/apple/RNGestureHandlerButton.mm -@@ -89,6 +89,52 @@ +@@ -82,6 +82,52 @@ } #if !TARGET_OS_OSX From 25d9ed335265a431743a5a34507609345f6ba839 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Wed, 8 Jul 2026 09:56:27 -0300 Subject: [PATCH 4/7] chore: regenerate webview patch for 13.16.0 Filename was stale-ahead (13.16.1 vs resolved 13.16.0). package.json pins react-native-webview to exact 13.16.0, so regenerate down to match (no dep bump). Android client-cert / mutual-TLS hunks are unchanged; only the version in the filename and the patch index hashes are corrected. --- ...e-webview+13.16.1.patch => react-native-webview+13.16.0.patch} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename patches/{react-native-webview+13.16.1.patch => react-native-webview+13.16.0.patch} (100%) diff --git a/patches/react-native-webview+13.16.1.patch b/patches/react-native-webview+13.16.0.patch similarity index 100% rename from patches/react-native-webview+13.16.1.patch rename to patches/react-native-webview+13.16.0.patch From eea023961417731fda759c8e1eef5f7a3d950e6f Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Wed, 8 Jul 2026 10:11:01 -0300 Subject: [PATCH 5/7] fix: drop async on no-op expo-av shim stubs (require-await lint) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dark expo-av shim declared async methods with no await, tripping the require-await eslint rule (15 errors, failing CI). Return Promise.resolve() from plain methods instead — identical return types and behavior, lint clean. --- app/lib/methods/helpers/expoAvShim.ts | 64 +++++++++++++-------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/app/lib/methods/helpers/expoAvShim.ts b/app/lib/methods/helpers/expoAvShim.ts index 7ed385739ea..69cb64f3143 100644 --- a/app/lib/methods/helpers/expoAvShim.ts +++ b/app/lib/methods/helpers/expoAvShim.ts @@ -91,40 +91,40 @@ const NOOP_PERMISSION_RESPONSE = { granted: false, status: 'undetermined', canAs // eslint-disable-next-line @typescript-eslint/no-namespace export namespace Audio { export class Sound { - static async createAsync(_source: unknown, _initialStatus?: unknown): Promise<{ sound: Sound; status: AVPlaybackStatus }> { - return { sound: new Sound(), status: RESOLVED_PLAYBACK_STATUS }; + static createAsync(_source: unknown, _initialStatus?: unknown): Promise<{ sound: Sound; status: AVPlaybackStatus }> { + return Promise.resolve({ sound: new Sound(), status: RESOLVED_PLAYBACK_STATUS }); } - async playAsync(): Promise { - return RESOLVED_PLAYBACK_STATUS; + playAsync(): Promise { + return Promise.resolve(RESOLVED_PLAYBACK_STATUS); } - async pauseAsync(): Promise { - return RESOLVED_PLAYBACK_STATUS; + pauseAsync(): Promise { + return Promise.resolve(RESOLVED_PLAYBACK_STATUS); } - async stopAsync(): Promise { - return RESOLVED_PLAYBACK_STATUS; + stopAsync(): Promise { + return Promise.resolve(RESOLVED_PLAYBACK_STATUS); } - async unloadAsync(): Promise { - return RESOLVED_PLAYBACK_STATUS; + unloadAsync(): Promise { + return Promise.resolve(RESOLVED_PLAYBACK_STATUS); } - async loadAsync(_source: unknown): Promise { - return RESOLVED_PLAYBACK_STATUS; + loadAsync(_source: unknown): Promise { + return Promise.resolve(RESOLVED_PLAYBACK_STATUS); } - async setPositionAsync(_millis: number): Promise { - return RESOLVED_PLAYBACK_STATUS; + setPositionAsync(_millis: number): Promise { + return Promise.resolve(RESOLVED_PLAYBACK_STATUS); } - async setRateAsync(_rate: number, _shouldCorrectPitch?: boolean): Promise { - return RESOLVED_PLAYBACK_STATUS; + setRateAsync(_rate: number, _shouldCorrectPitch?: boolean): Promise { + return Promise.resolve(RESOLVED_PLAYBACK_STATUS); } - async setIsLoopingAsync(_isLooping: boolean): Promise { - return RESOLVED_PLAYBACK_STATUS; + setIsLoopingAsync(_isLooping: boolean): Promise { + return Promise.resolve(RESOLVED_PLAYBACK_STATUS); } setOnPlaybackStatusUpdate(_callback: ((status: AVPlaybackStatus) => void) | null): void {} @@ -140,18 +140,18 @@ export namespace Audio { } export class Recording { - async prepareToRecordAsync(_options?: RecordingOptions): Promise { - return { canRecord: true, isRecording: false, isDoneRecording: false, durationMillis: 0 }; + prepareToRecordAsync(_options?: RecordingOptions): Promise { + return Promise.resolve({ canRecord: true, isRecording: false, isDoneRecording: false, durationMillis: 0 }); } setOnRecordingStatusUpdate(_callback: ((status: RecordingStatus) => void) | null): void {} - async startAsync(): Promise { - return { canRecord: true, isRecording: true, isDoneRecording: false, durationMillis: 0 }; + startAsync(): Promise { + return Promise.resolve({ canRecord: true, isRecording: true, isDoneRecording: false, durationMillis: 0 }); } - async stopAndUnloadAsync(): Promise { - return { canRecord: false, isRecording: false, isDoneRecording: true, durationMillis: 0 }; + stopAndUnloadAsync(): Promise { + return Promise.resolve({ canRecord: false, isRecording: false, isDoneRecording: true, durationMillis: 0 }); } getURI(): string | null { @@ -159,7 +159,7 @@ export namespace Audio { } } - export const setAudioModeAsync = async (_mode: Partial): Promise => {}; + export const setAudioModeAsync = (_mode: Partial): Promise => Promise.resolve(); export const AndroidOutputFormat = { AAC_ADTS: 6 } as const; export const AndroidAudioEncoder = { AAC: 3 } as const; @@ -188,13 +188,11 @@ export namespace Audio { } }; - export const requestPermissionsAsync = async (): Promise<{ granted: boolean; status: string; canAskAgain: boolean }> => ({ - ...NOOP_PERMISSION_RESPONSE - }); + export const requestPermissionsAsync = (): Promise<{ granted: boolean; status: string; canAskAgain: boolean }> => + Promise.resolve({ ...NOOP_PERMISSION_RESPONSE }); - export const getPermissionsAsync = async (): Promise<{ granted: boolean; status: string; canAskAgain: boolean }> => ({ - ...NOOP_PERMISSION_RESPONSE - }); + export const getPermissionsAsync = (): Promise<{ granted: boolean; status: string; canAskAgain: boolean }> => + Promise.resolve({ ...NOOP_PERMISSION_RESPONSE }); } interface VideoProps { @@ -212,8 +210,8 @@ interface VideoProps { } export class Video extends Component { - async stopAsync(): Promise { - return RESOLVED_PLAYBACK_STATUS; + stopAsync(): Promise { + return Promise.resolve(RESOLVED_PLAYBACK_STATUS); } render() { From 9a46c6157af399efdc7dc3c841814cda0d685bf9 Mon Sep 17 00:00:00 2001 From: diegolmello Date: Wed, 8 Jul 2026 13:13:42 +0000 Subject: [PATCH 6/7] chore: format code and fix lint issues --- app/containers/AudioPlayer/index.tsx | 2 +- .../MessageComposer/components/Buttons/MicOrSendButton.tsx | 2 +- .../MessageComposer/components/RecordAudio/Duration.tsx | 2 +- .../MessageComposer/components/RecordAudio/RecordAudio.tsx | 2 +- app/containers/Ringer/index.tsx | 3 ++- app/lib/methods/AudioManager.ts | 2 +- app/lib/services/voip/playCallEndedSound.ts | 1 - app/views/AttachmentView.tsx | 2 +- app/views/CallView/components/Dialpad/DialpadContext.tsx | 1 + app/views/CallView/index.tsx | 2 +- app/views/ShareView/Preview.tsx | 2 +- 11 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/containers/AudioPlayer/index.tsx b/app/containers/AudioPlayer/index.tsx index 60e91407c87..34669e75c80 100644 --- a/app/containers/AudioPlayer/index.tsx +++ b/app/containers/AudioPlayer/index.tsx @@ -1,10 +1,10 @@ import { useEffect, useRef, useState } from 'react'; import { InteractionManager, View } from 'react-native'; -import { type AVPlaybackStatus } from '../../lib/methods/helpers/expoAvShim'; import { activateKeepAwake, deactivateKeepAwake } from 'expo-keep-awake'; import { useSharedValue } from 'react-native-reanimated'; import { useNavigation } from '@react-navigation/native'; +import { type AVPlaybackStatus } from '../../lib/methods/helpers/expoAvShim'; import { useTheme } from '../../theme'; import styles from './styles'; import Seek from './Seek'; diff --git a/app/containers/MessageComposer/components/Buttons/MicOrSendButton.tsx b/app/containers/MessageComposer/components/Buttons/MicOrSendButton.tsx index 51054fa0779..384b256bf58 100644 --- a/app/containers/MessageComposer/components/Buttons/MicOrSendButton.tsx +++ b/app/containers/MessageComposer/components/Buttons/MicOrSendButton.tsx @@ -1,8 +1,8 @@ -import { Audio } from '../../../../lib/methods/helpers/expoAvShim'; import { useContext, type ReactElement } from 'react'; import { Alert } from 'react-native'; import { PermissionStatus } from 'expo-camera'; +import { Audio } from '../../../../lib/methods/helpers/expoAvShim'; import i18n from '../../../../i18n'; import { useAppSelector } from '../../../../lib/hooks/useAppSelector'; import { openAppSettings } from '../../../../lib/methods/helpers/openAppSettings'; diff --git a/app/containers/MessageComposer/components/RecordAudio/Duration.tsx b/app/containers/MessageComposer/components/RecordAudio/Duration.tsx index 35534b861ed..70e34cfca58 100644 --- a/app/containers/MessageComposer/components/RecordAudio/Duration.tsx +++ b/app/containers/MessageComposer/components/RecordAudio/Duration.tsx @@ -1,7 +1,7 @@ import { forwardRef, useImperativeHandle, useState } from 'react'; import { type FontVariant, Text } from 'react-native'; -import { type Audio } from '../../../../lib/methods/helpers/expoAvShim'; +import { type Audio } from '../../../../lib/methods/helpers/expoAvShim'; import sharedStyles from '../../../../views/Styles'; import { useTheme } from '../../../../theme'; import { formatTime } from './utils'; diff --git a/app/containers/MessageComposer/components/RecordAudio/RecordAudio.tsx b/app/containers/MessageComposer/components/RecordAudio/RecordAudio.tsx index 2b6512c64a9..85810db0055 100644 --- a/app/containers/MessageComposer/components/RecordAudio/RecordAudio.tsx +++ b/app/containers/MessageComposer/components/RecordAudio/RecordAudio.tsx @@ -1,10 +1,10 @@ import { View, Text } from 'react-native'; import { useEffect, useRef, useState, type ReactElement } from 'react'; -import { Audio } from '../../../../lib/methods/helpers/expoAvShim'; import { getInfoAsync } from 'expo-file-system/legacy'; import { useKeepAwake } from 'expo-keep-awake'; import { shallowEqual } from 'react-redux'; +import { Audio } from '../../../../lib/methods/helpers/expoAvShim'; import { useTheme } from '../../../../theme'; import { BaseButton } from '../Buttons'; import { CustomIcon } from '../../../CustomIcon'; diff --git a/app/containers/Ringer/index.tsx b/app/containers/Ringer/index.tsx index b1fa7c780a5..ec8445d0950 100644 --- a/app/containers/Ringer/index.tsx +++ b/app/containers/Ringer/index.tsx @@ -1,6 +1,7 @@ -import { Audio } from '../../lib/methods/helpers/expoAvShim'; import { useEffect, useRef, memo } from 'react'; +import { Audio } from '../../lib/methods/helpers/expoAvShim'; + export enum ERingerSounds { DIALTONE = 'dialtone', RINGTONE = 'ringtone' diff --git a/app/lib/methods/AudioManager.ts b/app/lib/methods/AudioManager.ts index f02e79a9cf2..12ddc7bd5b5 100644 --- a/app/lib/methods/AudioManager.ts +++ b/app/lib/methods/AudioManager.ts @@ -1,6 +1,6 @@ -import { type AVPlaybackStatus, Audio } from './helpers/expoAvShim'; import { Q } from '@nozbe/watermelondb'; +import { type AVPlaybackStatus, Audio } from './helpers/expoAvShim'; import dayjs from '../dayjs'; import { getMessageById } from '../database/services/Message'; import database from '../database'; diff --git a/app/lib/services/voip/playCallEndedSound.ts b/app/lib/services/voip/playCallEndedSound.ts index 7ed234231fc..e36e5161838 100644 --- a/app/lib/services/voip/playCallEndedSound.ts +++ b/app/lib/services/voip/playCallEndedSound.ts @@ -1,5 +1,4 @@ import { Audio } from '../../methods/helpers/expoAvShim'; - import log from '../../methods/helpers/log'; // Module-scoped state so it survives React tree unmounts and is safe to call diff --git a/app/views/AttachmentView.tsx b/app/views/AttachmentView.tsx index 731542e8e9f..5da50f19b03 100644 --- a/app/views/AttachmentView.tsx +++ b/app/views/AttachmentView.tsx @@ -1,12 +1,12 @@ import { CameraRoll } from '@react-native-camera-roll/camera-roll'; import { useHeaderHeight } from '@react-navigation/elements'; -import { ResizeMode, Video } from '../lib/methods/helpers/expoAvShim'; import { useCallback, useLayoutEffect, useRef, useState, type Dispatch, type SetStateAction, type ReactElement } from 'react'; import { PermissionsAndroid, useWindowDimensions, View } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { shallowEqual } from 'react-redux'; import * as FileSystem from 'expo-file-system/legacy'; +import { ResizeMode, Video } from '../lib/methods/helpers/expoAvShim'; import { isImageBase64 } from '../lib/methods/isImageBase64'; import RCActivityIndicator from '../containers/ActivityIndicator'; import AltTextLabel from '../containers/AltTextLabel'; diff --git a/app/views/CallView/components/Dialpad/DialpadContext.tsx b/app/views/CallView/components/Dialpad/DialpadContext.tsx index 8debd4c8123..bdfa33b79be 100644 --- a/app/views/CallView/components/Dialpad/DialpadContext.tsx +++ b/app/views/CallView/components/Dialpad/DialpadContext.tsx @@ -1,4 +1,5 @@ import { createContext, type ReactNode, useContext, useEffect, useRef } from 'react'; + import { Audio, InterruptionModeAndroid, InterruptionModeIOS } from '../../../../lib/methods/helpers/expoAvShim'; const DTMF_ASSETS: Record> = { diff --git a/app/views/CallView/index.tsx b/app/views/CallView/index.tsx index 259dc0f5de3..d02541c5b12 100644 --- a/app/views/CallView/index.tsx +++ b/app/views/CallView/index.tsx @@ -1,6 +1,6 @@ import { type ReactElement, useEffect } from 'react'; -import { Audio, InterruptionModeIOS } from '../../lib/methods/helpers/expoAvShim'; +import { Audio, InterruptionModeIOS } from '../../lib/methods/helpers/expoAvShim'; import { useCallStore } from '../../lib/services/voip/useCallStore'; import CallerInfo from './components/CallerInfo'; import { styles } from './styles'; diff --git a/app/views/ShareView/Preview.tsx b/app/views/ShareView/Preview.tsx index d4077f00abe..dcdac0e9f65 100644 --- a/app/views/ShareView/Preview.tsx +++ b/app/views/ShareView/Preview.tsx @@ -1,10 +1,10 @@ import { memo, useState } from 'react'; -import { Video, ResizeMode } from '../../lib/methods/helpers/expoAvShim'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { ScrollView, StyleSheet, Text, useWindowDimensions, View } from 'react-native'; import prettyBytes from 'pretty-bytes'; import { useHeaderHeight } from '@react-navigation/elements'; +import { Video, ResizeMode } from '../../lib/methods/helpers/expoAvShim'; import { CustomIcon, type TIconsName } from '../../containers/CustomIcon'; import { ImageViewer } from '../../containers/ImageViewer'; import sharedStyles from '../Styles'; From 912f90c9526308eebffc09ad102f497a890659f5 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Wed, 8 Jul 2026 13:42:41 -0300 Subject: [PATCH 7/7] fix: migrate iOS AppDelegate to Expo SDK 55 factory API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Expo SDK 55 removed bindReactNativeFactory (expo/expo#39418) and moved recreateRootView into the factory, and its generated ExpoModulesProvider.swift now uses `internal import Expo` (SE-0409), making the bare `import Expo` ambiguous. - `public import Expo` — explicit access level; public since AppDelegate is a public subclass of ExpoAppDelegate - RCTReactNativeFactory -> ExpoReactNativeFactory (+ delegate base RCTDefaultReactNativeFactoryDelegate -> ExpoReactNativeFactoryDelegate) - drop the removed bindReactNativeFactory call --- ios/AppDelegate.swift | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ios/AppDelegate.swift b/ios/AppDelegate.swift index 2699b2c7fba..733516ace8a 100644 --- a/ios/AppDelegate.swift +++ b/ios/AppDelegate.swift @@ -1,4 +1,4 @@ -import Expo +public import Expo import React import ReactAppDependencyProvider import Firebase @@ -11,7 +11,7 @@ public class AppDelegate: ExpoAppDelegate { var window: UIWindow? var reactNativeDelegate: ReactNativeDelegate? - var reactNativeFactory: RCTReactNativeFactory? + var reactNativeFactory: ExpoReactNativeFactory? var watchConnection: WatchConnection? public override func application( @@ -38,12 +38,11 @@ public class AppDelegate: ExpoAppDelegate { } let delegate = ReactNativeDelegate() - let factory = RCTReactNativeFactory(delegate: delegate) + let factory = ExpoReactNativeFactory(delegate: delegate) delegate.dependencyProvider = RCTAppDependencyProvider() reactNativeDelegate = delegate reactNativeFactory = factory - bindReactNativeFactory(factory) #if os(iOS) || os(tvOS) window = UIWindow(frame: UIScreen.main.bounds) @@ -89,7 +88,7 @@ public class AppDelegate: ExpoAppDelegate { } } -class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate { +class ReactNativeDelegate: ExpoReactNativeFactoryDelegate { override func sourceURL(for bridge: RCTBridge) -> URL? { self.bundleURL() }