Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions __mocks__/expo-av.ts

This file was deleted.

24 changes: 19 additions & 5 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
orientation: 'default',
icon: './assets/icon.png',
userInterfaceStyle: 'automatic',
newArchEnabled: true,
updates: {
fallbackToCacheTimeout: 0,
},
Expand Down Expand Up @@ -212,7 +211,10 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
[
'@rnmapbox/maps',
{
RNMapboxMapsVersion: '11.8.0',
// Keep in step with the `mapbox` field of the installed @rnmapbox/maps — the JS
// bindings are generated against a specific native SDK, and pinning an older one
// makes style props the bindings emit (symbolZOffset and friends) trap natively.
RNMapboxMapsVersion: '11.23.1',
},
],
[
Expand All @@ -224,6 +226,11 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
'Resgrid Dispatch uses your location, including in the background, to keep the department map updated with your position. For example, while you are working a call away from the console, your location is periodically sent so other dispatchers and responders can see where you are, even when the app is not on screen.',
locationAlwaysPermission:
'Resgrid Dispatch uses your location in the background to keep the department map updated with your position. For example, while you are working a call away from the console, your location is periodically sent so other dispatchers and responders can see where you are, even when the app is not on screen.',
// Required even though getMotionActivityAsync() is never called: expo-location links
// CoreMotion (MotionActivityPermissionRequester), and App Store static analysis rejects
// the binary with ITMS-90683 whenever the framework is referenced and the string is absent.
motionUsagePermission:
'Resgrid Dispatch uses motion data to improve the accuracy of the location shown on the department map. For example, while you are driving to an incident, motion data helps distinguish travel from a stop so other dispatchers and responders see an accurate position.',
isIosBackgroundLocationEnabled: true,
isAndroidBackgroundLocationEnabled: true,
isAndroidForegroundServiceEnabled: true,
Expand Down Expand Up @@ -257,10 +264,13 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
android: {
extraProguardRules: '-keep class expo.modules.location.** { *; }',
extraMavenRepos: ['../../node_modules/@notifee/react-native/android/libs'],
targetSdkVersion: 35,
targetSdkVersion: 36,
},
ios: {
deploymentTarget: '18.1',
// Apps built with the iOS 27 SDK must adopt the UIKit scene life cycle or they are
// killed at launch. Remove once on SDK 58, whose template adopts it by default.
enableSceneSupport: true,
},
},
],
Expand Down Expand Up @@ -304,7 +314,7 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
'expo-navigation-bar',
{
position: 'relative',
visibility: 'hidden',
hidden: true,
behavior: 'inset-touch',
},
],
Expand All @@ -328,9 +338,13 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
],
'@config-plugins/react-native-callkeep',
'expo-web-browser',
'expo-image',
'expo-sharing',
'expo-status-bar',
'./customGradle.plugin.js',
'./customManifest.plugin.js',
['app-icon-badge', appIconBadgeConfig],
'./plugins/withResourceBundleDeploymentTarget.js',
['./plugins/withIconBadge.js', appIconBadgeConfig],
],
extra: {
...ClientEnv,
Expand Down
11 changes: 11 additions & 0 deletions electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,17 @@ app.whenReady().then(() => {
});
});

// Settings such as the selected server URL live in the renderer's localStorage, which
// Chromium writes to disk lazily. Flush it before exiting so a change made just before
// quitting survives the next launch.
app.on('before-quit', () => {
try {
session.defaultSession.flushStorageData();
} catch (err) {
console.error('Failed to flush storage data before quit:', err);
}
});

app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
Expand Down
4 changes: 4 additions & 0 deletions jest-env-setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Must run before jest-expo's preset setup requires `expo/src/winter`.
// Uses React Native's fetch in tests instead of expo's winter fetch, whose
// FetchResponse extends a native class that is unavailable after jest teardown.
process.env.EXPO_PUBLIC_USE_RN_FETCH = '1';
3 changes: 2 additions & 1 deletion jest-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jest.mock('expo-audio', () => ({
pause: jest.fn(),
remove: jest.fn(),
replace: jest.fn(),
seekTo: jest.fn(),
seekTo: jest.fn().mockResolvedValue(undefined),
addListener: jest.fn(() => ({ remove: jest.fn() })),
playing: false,
paused: false,
isLoaded: true,
Expand Down
12 changes: 9 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
const expoPreset = require('jest-expo/jest-preset');

// Must be set before babel-preset-expo transforms modules (it inlines
// EXPO_PUBLIC_* vars) — makes expo's winter runtime keep RN's fetch in tests.
process.env.EXPO_PUBLIC_USE_RN_FETCH = '1';

module.exports = {
preset: 'jest-expo',
// Reanimated v4 worklets: resolve to the non-native builds in Jest
// (vendored — worklets 0.5.1 does not ship jest/resolver.js)
resolver: '<rootDir>/jest.resolver.js',
resolver: 'react-native-worklets/jest/resolver.js',
setupFiles: ['<rootDir>/jest-env-setup.js', ...(expoPreset.setupFiles ?? [])],
setupFilesAfterEnv: ['<rootDir>/jest-setup.ts'],
testMatch: ['**/?(*.)+(spec|test).ts?(x)'],
testPathIgnorePatterns: ['<rootDir>/node_modules/', '\\.\\._.*'],
Expand All @@ -11,7 +17,7 @@ module.exports = {
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
moduleDirectories: ['node_modules', '<rootDir>/'],
transformIgnorePatterns: [
'node_modules/(?!((jest-)?react-native|@react-native(-community)?|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@sentry/react-native|native-base|react-native-svg|@legendapp/motion|@gluestack-ui|nativewind|react-native-css|expo-audio|@aptabase/.*|@shopify/flash-list))',
'node_modules/(?!((jest-)?react-native|@react-native(-community)?|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|standard-navigation|@sentry/react-native|native-base|react-native-svg|@legendapp/motion|@gluestack-ui|nativewind|react-native-css|expo-audio|@aptabase/.*|@dev-plugins/.*|@shopify/flash-list))',
],
coverageReporters: ['json-summary', ['text', { file: 'coverage.txt' }], 'cobertura'],
reporters: [
Expand Down
15 changes: 0 additions & 15 deletions jest.resolver.js

This file was deleted.

Loading
Loading