Release/v3.3.2 cleaned#2
Open
richardblondet wants to merge 19 commits into
Open
Conversation
…leanup :NORMAL: Chore/App Modernisation [LARGE]
Summary of Changes
This PR addresses several improvements and fixes in the project, including:
PropTypes Warning Fix:
Resolved PropTypes warnings in the react-native-hyperlink library by creating a patch (react-native-hyperlink+0.0.19.patch) to replace textPropTypes.style with PropTypes.any.
Codebase Updates:
Refactored index.js to use default parameters instead of defaultProps.
Made updates to the following files for improved functionality and consistency:
form.js
alerts.js
index.js
index.js
Environment and Setup:
Added .nvmrc for Node.js version management.
Updated .env.sample and added LOCAL_SETUP.md for better developer onboarding.
Created a backup of build.gradle as build.gradle.backup.
Dependency Management:
Removed outdated yarn.lock files to ensure consistency with package-lock.json.
Documentation:
Updated oauth-variables.md to reflect changes in environment variables.
Metro Bundler:
Restarted Metro with --reset-cache to ensure the changes are applied.
modified: metro.config.js modified: patches/react-native-hyperlink+0.0.19.patch
Changes to be committed: deleted: patches/react-native+0.70.0.patch deleted: patches/react-native-audio-recorder-player+3.5.1.patch deleted: patches/react-native-dialogs+1.1.1.patch
fix: [release/v3.3.2-cleaned-2]
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Merges a cleaned release/v3.3.2 branch into master, largely focused on modernizing the React Native app (iOS/Android build settings, dependencies, and type tooling), plus updates to sharing/report export flows and added operational/error reporting hooks.
Changes:
- Updates iOS/Android project configuration (privacy manifest, SDK/Gradle upgrades, scheme/app delegate changes, permissions, network security config).
- Refactors sharing/export flows so share operations return a result and conditionally mark items as uploaded/completed.
- Removes Flow config/libdefs and a large suite of Jest tests/mocks; adds/updates docs and environment variable guidance.
Reviewed changes
Copilot reviewed 240 out of 282 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| ios/GoogleService-Info.plist | Adds Firebase config plist (contains API key/client IDs). |
| ios/ForestWatcher/PrivacyInfo.xcprivacy | Adds iOS privacy manifest for accessed APIs. |
| ios/ForestWatcher/Info.plist | Updates iOS minimum version/ATS and adds FB client token + mic usage text. |
| ios/ForestWatcher/AppDelegate.mm | Updates RN app delegate bootstrapping + FB/Firebase imports. |
| ios/ForestWatcher/AppDelegate.h | Switches AppDelegate to inherit from RCTAppDelegate. |
| ios/ForestWatcher.xcodeproj/xcshareddata/xcschemes/ForestWatcher.xcscheme | Updates scheme version and sets LaunchAction to Release. |
| index.js | Updates entry import to TSX and removes LogBox/StatusBar logic. |
| gradlew.bat | Removes root Windows gradle wrapper script. |
| gradle/wrapper/gradle-wrapper.properties | Removes root gradle wrapper properties. |
| flow-typed/npm/xmldom_v0.x.x.js | Removes Flow libdef. |
| flow-typed/npm/uuid_v7.x.x.js | Removes Flow libdef. |
| flow-typed/npm/utm-latlng_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/url-parse_v1.3.x.js | Removes Flow libdef. |
| flow-typed/npm/tiny-emitter_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/redux_v4.x.x.js | Removes Flow libdef. |
| flow-typed/npm/redux-thunk_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/react-native-zip-archive_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/react-native-webview_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/react-native-timer_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/react-native-snap-carousel_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/react-native-share_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/react-native-scrollable-tab-view_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/react-native-safe-area_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/react-native-progress_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/react-native-keyboard-spacer_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/react-native-keyboard-aware-scroll-view_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/react-native-hyperlink_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/react-native-get-random-values_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/react-native-fs_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/react-native-document-picker_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/react-native-dialogs_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/react-native-datepicker_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/react-native-config_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/react-native-compass-heading_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/react-native-app-auth_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/react-native-actions-sheet_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/prop-types_v15.x.x.js | Removes Flow libdef. |
| flow-typed/npm/lottie-react-native_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/lottie-ios_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/kdbush_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/json2csv_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/i18next_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/geokdbush_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/geojson-polygon-self-intersections_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/formatcoords_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/d3-dsv_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/buffer_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/boundingbox_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/@turf/kinks_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/@turf/intersect_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/@turf/helpers_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/@turf/bbox_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/@turf/bbox-polygon_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/@tmcw/togeojson_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/@react-native-community/cookies_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/@mauron85/react-native-background-geolocation_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/@mapbox/togeojson_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/@mapbox/tilebelt_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/@mapbox/geojson-area_vx.x.x.js | Removes Flow libdef. |
| flow-typed/npm/@mapbox/geo-viewport_vx.x.x.js | Removes Flow libdef. |
| docs/mobile/writing-tests.md | Removes legacy testing doc. |
| docs/mobile/testing.md | Removes legacy testing doc. |
| docs/mobile/sharing-bundles.md | Adds detailed sharing bundle documentation. |
| docs/mobile/environment-vars/other-third-party-variables.md | Adds Mapbox Maven credential guidance. |
| docs/mobile/environment-vars/oauth-variables.md | Adds FB client token env var docs. |
| bitbucket-pipelines.yml | Updates CI Node image. |
| babel.config.js | Switches to @react-native babel preset. |
| app/store.js | Formatting change; offline middleware destructuring. |
| app/screens/index.js | Formatting change for component registration wrapper. |
| app/redux-modules/user.js | Adds socialEmail and changes logout dispatch timing. |
| app/redux-modules/routes.js | Updates import path and logout reset behavior. |
| app/redux-modules/areas.js | Sanitizes area name when building JPG filenames. |
| app/redux-modules/alerts.js | Renames storeAlertsFromCSV import casing. |
| app/offline/effect.js | Captures offline effect failures in Sentry. |
| app/main.tsx | Adds better typing, try/catch for Apple credential state, default options cast. |
| app/locales/pt.json | Adds new settings/profile strings. |
| app/locales/nl.json | Adds new settings/profile strings. |
| app/locales/mg.json | Adds new settings/profile strings. |
| app/locales/id.json | Adds new settings/profile strings. |
| app/locales/fr.json | Adds new settings/profile strings. |
| app/locales/es.json | Adds new settings/profile strings. |
| app/locales/en.json | Adds new settings/profile strings. |
| app/helpers/sortContextualLayers.js | Collapses tree cover loss detection into one line. |
| app/helpers/sharing/shareBundle.js | Makes shareBundle return share result. |
| app/helpers/sharing/importBundle.js | Changes unzip flow (removes Android-specific branch). |
| app/helpers/sharing/importAppData.js | Formats importTemplates call. |
| app/helpers/sharing/exportFileManifest.js | Passes report.index to queryReportFiles. |
| app/helpers/sharing/exportBundle.js | Minor formatting; separates calculations. |
| app/helpers/shareFile.js | Refactors to return Share.open result and sets failOnCancel=false. |
| app/helpers/report-store/storeReportFiles.js | Adds filename index extraction helper for attachments. |
| app/helpers/mapbox.js | Formats bbox-to-bounds conversion. |
| app/helpers/map.js | Filters polygon points before bounding box compute. |
| app/helpers/layer-store/storeLayerFiles.js | Formatting; collapses URL/fetch chain. |
| app/helpers/layer-store/import/importLayerFile.js | Simplifies extension extraction. |
| app/helpers/layer-store/import/convertToGeoJSON.tsx | Switches to @xmldom/xmldom + adds TS return typing. |
| app/helpers/forms.js | Refactors conditional question navigation logic. |
| app/helpers/fileManagement.js | Simplifies destination path construction. |
| app/helpers/analytics.js | Simplifies fileType extraction. |
| app/helpers/alert-store/storeAlerts.js | Captures alert-store failures in Sentry. |
| app/helpers/alert-store/queryAlerts.js | Reflows SQL predicate string formatting. |
| app/helpers/tests/exportReports.js | Removes tests. |
| app/helpers/tests/dataFormatting.js | Removes tests. |
| app/containers/welcome/index.js | Collapses connect() call to one line. |
| app/containers/sync/index.js | Adds Sentry capture on critical sync error; collapses connect(). |
| app/containers/setup/draw-areas/index.js | Collapses connect() call to one line. |
| app/containers/setup/create-area/index.js | Collapses connect() call to one line. |
| app/containers/setup/country/index.js | Collapses connect() call to one line. |
| app/containers/settings/mapping-files/index.js | Returns shareBundle result; collapses connect(). |
| app/containers/settings/index.js | Uses share result to conditionally set uploaded; adds social props. |
| app/containers/settings/coordinates-dropdown/index.js | Collapses connect() call to one line. |
| app/containers/routes/save-route/index.js | Collapses connect() call to one line. |
| app/containers/routes/route-detail/index.js | Collapses connect() call to one line. |
| app/containers/routes/index.js | Returns share result; adds (duplicate) syncRoutes mapping. |
| app/containers/reports/index.js | Conditionally marks exported reports uploaded based on share result. |
| app/containers/map/reports/index.js | Collapses connect() call to one line. |
| app/containers/map/index.js | Minor memoizeOne formatting; collapses connect(). |
| app/containers/map-sidebar/index.js | Collapses connect() call to one line. |
| app/containers/login/index.js | Collapses connect() call to one line. |
| app/containers/login/email-login/index.js | Collapses connect() call to one line. |
| app/containers/home/index.js | Collapses connect() call to one line. |
| app/containers/form/form.js | Fixes template indexing expression; collapses connect(). |
| app/containers/form/answers.js | Returns share results; adds completeReport dispatch. |
| app/containers/dashboard/index.js | Collapses connect() call to one line. |
| app/containers/common/download/index.js | Collapses connect() call to one line. |
| app/containers/areas/index.js | Returns share result; collapses connect(). |
| app/containers/areas/area-detail/index.js | Collapses connect() call to one line. |
| app/config/theme/index.js | Tweaks spacing/padding values. |
| app/config/constants/index.js | Adjusts location tracking settings; formats contextual layer URLs. |
| app/components/toast-notification/index.js | Safely handles missing initialWindowMetrics insets. |
| app/components/teams/index.js | Simplifies useEffect formatting. |
| app/components/teamDetails/index.js | Simplifies useEffect formatting. |
| app/components/sync/styles.js | Adds aspectRatio comment/fix for Lottie v6+. |
| app/components/setup/create-area/index.js | Simplifies extension extraction. |
| app/components/settings/styles.js | Layout/style updates for account/profile section. |
| app/components/settings/mapping-files/mapping-file-row/index.js | Uses raw name for custom layers instead of i18n key. |
| app/components/settings/mapping-files/import/type/index.js | Simplifies extension extraction. |
| app/components/routes/index.js | Ensures archiving state resets in finally. |
| app/components/reports/index.js | Refactors export flow and returns share results for CSV export. |
| app/components/map/index.js | Safely handles insets and stores top inset in state. |
| app/components/map/alerts/dataset-category/index.js | Formats kdbush invocation. |
| app/components/location-permissions/index.js | Requests Android notifications permission along with location. |
| app/components/form/answers.js | Marks report complete before exporting; shows success notification on share success. |
| app/components/common/topbar/offlineModal.js | Simplifies useEffect and connect() formatting. |
| app/components/common/sync-container/index.js | Simplifies useEffect formatting. |
| app/components/common/row/index.js | Avoids repeated props.action access; uses derived icon variable. |
| app/components/common/form-inputs/text-detail/index.js | Removes Animated.View container. |
| app/components/common/form-inputs/blob/index.js | Increases camera quality setting. |
| app/components/common/form-inputs/audio/recordingAnimation.js | Removes unused props and simplifies useEffect; adjusts defaults. |
| app/components/common/form-inputs/audio/index.js | Adjusts playback end detection and seek forward behavior. |
| app/components/common/form-inputs/audio/idleView.js | Removes subtitle text. |
| app/components/common/download/index.js | Formats Alert buttons array. |
| app/components/assignments/index.js | Simplifies useEffect formatting. |
| app/components/assignmentDetails/index.js | Simplifies useEffect formatting. |
| app/components/areas/index.js | Ensures archiving state resets in finally. |
| android/settings.gradle | Adopts RN Gradle plugin/autolinking settings. |
| android/gradlew.bat | Updates wrapper script + license URL + exit code handling. |
| android/gradle/wrapper/gradle-wrapper.properties | Upgrades Gradle wrapper version and adds validation/timeout. |
| android/gradle.properties | Removes committed secret; adds modern RN/Gradle properties and docs. |
| android/build.gradle | Upgrades Android SDK/AGP setup and Mapbox credential lookup. |
| android/app/src/main/res/xml/network_security_config.xml | Adds emulator IP domains for cleartext. |
| android/app/src/main/java/com/forestwatcher/MainApplication.kt | Adds Kotlin MainApplication for RN/RNN integration. |
| android/app/src/main/java/com/forestwatcher/MainActivity.kt | Converts MainActivity to Kotlin equivalent. |
| android/app/src/main/java/com/forestwatcher/MainActivity.java | Removes legacy Java MainActivity. |
| android/app/src/main/AndroidManifest.xml | Updates permissions/exported flags; adds FB client token meta-data. |
| android/app/src/debug/AndroidManifest.xml | Simplifies debug manifest application tag. |
| android/Gemfile | Removes Android-local fastlane Gemfile. |
| tests/reduxTest.js | Removes tests. |
| tests/reduxMockStoreTest.js | Removes tests. |
| tests/redux-tests/setupModuleTest.js | Removes tests. |
| tests/redux-tests/countriesModuleTest.js | Removes tests. |
| tests/redux-tests/appModuleTest.js | Removes tests. |
| tests/redux-tests/alertsModuleTest.js | Removes tests. |
| tests/redux-tests/snapshots/setupModuleTest.js.snap | Removes snapshots. |
| tests/redux-tests/snapshots/alertsModuleTest.js.snap | Removes snapshots. |
| tests/networkDetectionTest.js | Removes tests. |
| tests/jestTest.js | Removes tests. |
| tests/helper-tests/validation/fileNamesTest.js | Removes tests. |
| tests/helper-tests/validation/snapshots/fileNamesTest.js.snap | Removes snapshots. |
| tests/componentTesting.js | Removes tests. |
| tests/combinedReducerTest.js | Removes tests. |
| tests/snapshots/reduxMockStoreTest.js.snap | Removes snapshots. |
| tests/snapshots/networkDetectionTest.js.snap | Removes snapshots. |
| tests/snapshots/jestTest.js.snap | Removes snapshots. |
| tests/snapshots/componentTesting.js.snap | Removes snapshots. |
| mocks/rn-fetch-blob.js | Removes mock. |
| mocks/react-native-zip-archive.js | Removes mock. |
| mocks/react-native-localize.js | Removes mock. |
| mocks/react-native-i18n.js | Removes mock. |
| mocks/react-native-config.js | Removes mock. |
| mocks/react-native-compass-heading.js | Removes mock. |
| mocks/@sentry/react-native.js | Removes mock. |
| mocks/@react-native-mapbox-gl/maps.js | Removes mock. |
| mocks/@react-native-firebase/app.js | Removes mock. |
| mocks/@react-native-firebase/analytics.js | Removes mock. |
| mocks/@react-native-community/netinfo.js | Removes mock. |
| mocks/@invertase/react-native-apple-authentication.js | Removes mock. |
| README.md | Adds link to sharing bundle docs and patch table entry. |
| Gemfile | Adds top-level Ruby gems for iOS tooling (cocoapods/xcodeproj constraints). |
| CHANGELOG.md | Removes v3.0.0 section. |
| .yarnrc.yml | Adds Yarn node-modules linker config. |
| .yarnrc | Adds Yarn nodeLinker flag (duplicate config). |
| .tx/config | Adds Transifex config. |
| .nvmrc | Pins Node version. |
| .flowconfig | Removes Flow config. |
| .eslintrc.json | Switches to @react-native eslint config and adds TS overrides. |
| .env.sample | Adds FB client token and removes DATA_API_* placeholders. |
| .copilot-ignore | Adds env ignore patterns. |
Comments suppressed due to low confidence (2)
app/containers/routes/index.js:41
- The
syncRoutesprop is defined twice in the same object literal. In JavaScript the latter definition silently overwrites the former, which is error-prone and can mask future edits. Remove one of the duplicate entries.
return await shareBundle(outputPath);
},
syncRoutes: (routes: Array<Route>) => {
dispatch(uploadRoutes(routes));
},
syncRoutes: (routes: Array<Route>) => {
dispatch(uploadRoutes(routes));
},
app/helpers/tests/exportReports.js:1
- A sizeable set of Jest tests (and supporting mocks/snapshots) is removed in this PR, while export/share behavior is being changed to depend on
successresults. If automated testing is still expected for this repo, consider replacing these removed tests with updated ones that validate the new sharing/export completion semantics (e.g., not marking reports as uploaded when share is canceled).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <key>REVERSED_CLIENT_ID</key> | ||
| <string>com.googleusercontent.apps.354420233841-3n5rv0tmqrhrkkid605t0o7sld843vmr</string> | ||
| <key>API_KEY</key> | ||
| <string>AIzaSyCHer0iBO388SPkA5GdhIzF_gKrysrtXvU</string> |
Comment on lines
+12
to
21
| export default async function shareFile(path: string, mimeType?: string): Promise<{success: boolean}> { | ||
| const res = await Share.open({ | ||
| saveToFiles: true, | ||
| url: `file://${path}`, | ||
| type: mimeType, | ||
| showAppsToView: true | ||
| }).catch(err => {}); // Ensures that the promise is resolved | ||
| showAppsToView: true, | ||
| failOnCancel: false | ||
| }) | ||
| return res; | ||
| } |
Comment on lines
88
to
+93
| const fixedUri = Platform.OS === 'android' ? uri : decodeURI(uri); | ||
| const stagingDir = await createTemporaryStagingDirectory(); | ||
|
|
||
| if (Platform.OS === 'ios') { | ||
| const fileName = fixedUri.substring(fixedUri.lastIndexOf('/') + 1); | ||
| // Replace trailing slash from `RNFS.TemporaryDirectoryPath` because it's presence is platform dependent | ||
| const tempZipPath = RNFS.TemporaryDirectoryPath.replace(/\/$/, '') + '/' + fileName.replace(/\.[^/.]+$/, '.zip'); | ||
| const fileName = fixedUri.substring(fixedUri.lastIndexOf('/') + 1); | ||
| // Replace trailing slash from `RNFS.TemporaryDirectoryPath` because it's presence is platform dependent | ||
| const tempZipPath = RNFS.TemporaryDirectoryPath.replace(/\/$/, '') + '/' + fileName.replace(/\.[^/.]+$/, '.zip'); |
| const conditions = question.conditions; | ||
| const answer = answers[currentIndex] || {}; | ||
| const isLastQuestion = questions.length - 1 === currentIndex + 1; | ||
| const getNextIndex = (currentIndex: number = 0): number => { |
| const answer = answers[parentQuestion] || {}; | ||
| conditionsMatch = nextHasConditions && answer.value === conditions[0].value; | ||
|
|
||
| if (isLastQuestion) { |
| </TestAction> | ||
| <LaunchAction | ||
| buildConfiguration = "Debug" | ||
| buildConfiguration = "Release" |
| <domain includeSubdomains="true">localhost</domain> | ||
| </domain-config> | ||
| <!-- deny cleartext traffic for React Native packager ips in release --> | ||
| <domain-config cleartextTrafficPermitted="true"> |
Comment on lines
+18
to
+19
| **Option 1: Use local.properties (Recommended)** | ||
| Create `android/local.properties` (this file is already gitignored) and add: |
| mediaType: 'photo', | ||
| noData: true, | ||
| quality: 0.7, | ||
| quality: 1.0, |
Comment on lines
+238
to
+239
| if (newValue >= this.state.playSpec.currentDurationSec - 1000) { | ||
| newValue = this.state.playSpec.currentDurationSec - 1000; |
1. Update docs regarding mapbox secret 2. npmrc file with legacy peer deps
fix: misc updates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
release/v3..3.2-cleanedintomaster