Skip to content

Commit 8a9f07b

Browse files
Merge branch 'dev' into fix/w3c-defects-revert
# Conflicts: # android/native.gradle # android/src/main/java/com/instabug/reactlibrary/Constants.java # examples/default/e2e/reportBug.e2e.ts # examples/default/ios/InstabugTests/InstabugSampleTests.m # examples/default/ios/Podfile.lock # examples/default/src/screens/apm/NetworkScreen.tsx # ios/RNInstabug/InstabugReactBridge.m # ios/native.rb
2 parents b24213e + 01225c5 commit 8a9f07b

File tree

70 files changed

+4016
-3620
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+4016
-3620
lines changed

.circleci/config.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ commands:
4646
type: boolean
4747
default: false
4848
steps:
49+
- run:
50+
name: Uninstall Existing CocoaPods
51+
command: gem uninstall -x cocoapods
52+
- run:
53+
name: Install CocoaPods
54+
command: gem install cocoapods:1.14.0
4955
- restore_cache:
5056
name: Restore Pods Cache
5157
keys:
@@ -252,7 +258,7 @@ jobs:
252258
# ios/upload_sourcemap.sh files respectively.
253259
sync_generated_files:
254260
macos:
255-
xcode: 13.4.1
261+
xcode: 15.4.0
256262
resource_class: macos.m1.medium.gen1
257263
steps:
258264
- advanced-checkout/shallow-checkout
@@ -275,7 +281,7 @@ jobs:
275281
type: boolean
276282
default: false
277283
macos:
278-
xcode: 13.4.1
284+
xcode: 15.4.0
279285
resource_class: macos.m1.medium.gen1
280286
working_directory: ~/project/examples/default
281287
environment:
@@ -295,7 +301,7 @@ jobs:
295301
-scheme InstabugExample \
296302
-resultBundlePath coverage/result.xcresult \
297303
-sdk iphonesimulator \
298-
-destination 'platform=iOS Simulator,name=iPhone 13 Pro Max,OS=15.5' \
304+
-destination 'platform=iOS Simulator,name=iPhone 15 Pro Max,OS=17.5' \
299305
test | xcpretty
300306
- when:
301307
condition: << parameters.collect_coverage >>
@@ -315,7 +321,7 @@ jobs:
315321
type: steps
316322
default: []
317323
macos:
318-
xcode: 13.4.1
324+
xcode: 15.4.0
319325
resource_class: macos.m1.medium.gen1
320326
environment:
321327
INSTABUG_SOURCEMAPS_UPLOAD_DISABLE: true
@@ -414,7 +420,7 @@ jobs:
414420

415421
publish:
416422
macos:
417-
xcode: 13.4.1
423+
xcode: 15.4.0
418424
resource_class: macos.m1.medium.gen1
419425
working_directory: '~'
420426
steps:

CHANGELOG.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,36 @@
11
# Changelog
22

3-
## [Unreleased](https://github.com/Instabug/Instabug-React-Native/compare/v13.3.0...dev)
3+
## [14.0.0](https://github.com/Instabug/Instabug-React-Native/compare/v13.4.0...14.0.0) (November 11, 2024)
4+
5+
### Added
6+
7+
- Add support for opting into session syncing ([#1292](https://github.com/Instabug/Instabug-React-Native/pull/1292)).
8+
9+
### Changed
10+
11+
- Bump Instabug iOS SDK to v14.0.0 ([#1312](https://github.com/Instabug/Instabug-React-Native/pull/1312)). [See release notes](https://github.com/Instabug/Instabug-iOS/releases/tag/14.0.0).
12+
- Bump Instabug Android SDK to v14.0.0 ([#1312](https://github.com/Instabug/Instabug-React-Native/pull/1312)). [See release notes](https://github.com/Instabug/Instabug-Android/releases/tag/v14.0.0).
13+
14+
### Fixed
15+
16+
- Replace thrown errors with logs ([#1220](https://github.com/Instabug/Instabug-React-Native/pull/1220))
17+
18+
## [13.4.0](https://github.com/Instabug/Instabug-React-Native/compare/v13.3.0...v13.4.0) (October 2, 2024)
419

520
### Added
621

722
- Add support for Expo Router navigation tracking ([#1270](https://github.com/Instabug/Instabug-React-Native/pull/1270)).
823
- Enhance the network interceptor to capture more client error messages ([#1257](https://github.com/Instabug/Instabug-React-Native/pull/1257)).
924

25+
### Changed
26+
27+
- Bump Instabug iOS SDK to v13.4.2 ([#1285](https://github.com/Instabug/Instabug-React-Native/pull/1285)). See release notes for [13.4.0](https://github.com/Instabug/Instabug-iOS/releases/tag/13.4.0), [13.4.1](https://github.com/Instabug/Instabug-iOS/releases/tag/13.4.1) and [13.4.2](https://github.com/Instabug/Instabug-iOS/releases/tag/13.4.2).
28+
- Bump Instabug Android SDK to v13.4.1 ([#1285](https://github.com/Instabug/Instabug-React-Native/pull/1285)). See release notes for [13.4.0](https://github.com/Instabug/Instabug-Android/releases/tag/v13.4.0) and [13.4.1](https://github.com/Instabug/Instabug-Android/releases/tag/v13.4.1).
29+
1030
### Fixed
1131

32+
- Fix an issue with JavaScript fatal crashes on iOS causing them to be reported as native iOS crashes instead. ([#1290](https://github.com/Instabug/Instabug-React-Native/pull/1290)).
33+
- Correctly resolve the flavor path when uploading sourcemaps on Android. ([#1225](https://github.com/Instabug/Instabug-React-Native/pull/1225)).
1234
- Drop non-error objects reported as crashes since they don't have a stack trace ([#1279](https://github.com/Instabug/Instabug-React-Native/pull/1279)).
1335
- Fix APM network logging on iOS when the response body is missing or empty. ([#1273](https://github.com/Instabug/Instabug-React-Native/pull/1273)).
1436

android/build.gradle

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ android {
5757
minSdkVersion getExtOrDefault('minSdkVersion').toInteger()
5858
targetSdkVersion getExtOrDefault('targetSdkVersion').toInteger()
5959
versionCode 1
60-
versionName "13.3.0"
60+
versionName "13.4.0"
6161
multiDexEnabled true
6262
ndk {
6363
abiFilters "armeabi-v7a", "x86"
@@ -79,3 +79,17 @@ dependencies {
7979
testImplementation "org.mockito:mockito-android:3.4.0"
8080
testImplementation 'junit:junit:4.13.2'
8181
}
82+
83+
rootProject.allprojects {
84+
repositories {
85+
google()
86+
jcenter()
87+
maven {
88+
url "https://mvn.instabug.com/nexus/repository/instabug-internal/"
89+
credentials {
90+
username "instabug"
91+
password System.getenv('INSTABUG_REPOSITORY_PASSWORD')
92+
}
93+
}
94+
}
95+
}

android/jacoco.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ task jacocoTestReport(type: JacocoReport) {
3737
'**/*Binding.*'
3838
]
3939

40-
def jClasses = "${project.buildDir}/intermediates/javac/debug/classes"
40+
def jClasses = "${project.buildDir}/intermediates/javac/debug/compileDebugJavaWithJavac/classes"
4141
def javaClasses = fileTree(dir: jClasses, excludes: excludes)
4242
def sourceDirs = ["${project.projectDir}/src/main/java"]
4343
classDirectories.from = files(javaClasses)

android/native.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
project.ext.instabug = [
2-
version: '13.4.0'
2+
version: '14.0.0'
33
]
44

55
dependencies {

android/sourcemaps.gradle

Lines changed: 59 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ gradle.projectsEvaluated {
1313
def start = name.startsWith(prefixes[0]) ? prefixes[0].length() : prefixes[1].length()
1414
def end = name.length() - suffix.length()
1515
def flavor = name.substring(start, end).uncapitalize()
16+
def defaultVersion = getDefaultVersion(flavor)
1617

17-
task.finalizedBy createUploadSourcemapsTask(flavor)
18+
task.finalizedBy createUploadSourcemapsTask(flavor, defaultVersion.name, defaultVersion.code)
1819
}
1920
}
2021

21-
Task createUploadSourcemapsTask(String flavor) {
22+
Task createUploadSourcemapsTask(String flavor, String defaultVersionName, String defaultVersionCode) {
2223
def name = 'uploadSourcemaps' + flavor.capitalize()
2324

2425
// Don't recreate the task if it already exists.
@@ -38,13 +39,7 @@ Task createUploadSourcemapsTask(String flavor) {
3839
try {
3940
def appProject = project(':app')
4041
def appDir = appProject.projectDir
41-
def flavorPath = flavor + (flavor.empty ? '' : '/')
42-
def sourceMapDest = "build/generated/sourcemaps/react/${flavorPath}release/index.android.bundle.map"
43-
def sourceMapFile = new File(appDir, sourceMapDest)
44-
45-
if (!sourceMapFile.exists()) {
46-
throw new InvalidUserDataException("Unable to find source map file at: ${sourceMapFile.absolutePath}")
47-
}
42+
def sourceMapFile = getSourceMapFile(appDir, flavor)
4843

4944
def jsProjectDir = rootDir.parentFile
5045
def instabugDir = new File(['node', '-p', 'require.resolve("instabug-reactnative/package.json")'].execute(null, rootDir).text.trim()).getParentFile()
@@ -53,9 +48,8 @@ Task createUploadSourcemapsTask(String flavor) {
5348
def inferredToken = executeShellScript(tokenShellFile, jsProjectDir)
5449
def appToken = resolveVar('App Token', 'INSTABUG_APP_TOKEN', inferredToken)
5550

56-
def projectConfig = appProject.android.defaultConfig
57-
def versionName = resolveVar('Version Name', 'INSTABUG_VERSION_NAME', "${projectConfig.versionName}")
58-
def versionCode = resolveVar('Version Code', 'INSTABUG_VERSION_CODE', "${projectConfig.versionCode}")
51+
def versionName = resolveVar('Version Name', 'INSTABUG_VERSION_NAME', defaultVersionName)
52+
def versionCode = resolveVar('Version Code', 'INSTABUG_VERSION_CODE', defaultVersionCode)
5953

6054
exec {
6155
def osCompatibility = Os.isFamily(Os.FAMILY_WINDOWS) ? ['cmd', '/c'] : []
@@ -80,6 +74,59 @@ Task createUploadSourcemapsTask(String flavor) {
8074
return provider.get()
8175
}
8276

77+
File getSourceMapFile(File appDir, String flavor) {
78+
def defaultFlavorPath = flavor.empty ? 'release' : "${flavor}Release"
79+
def defaultSourceMapDest = "build/generated/sourcemaps/react/${defaultFlavorPath}/index.android.bundle.map"
80+
def defaultSourceMapFile = new File(appDir, defaultSourceMapDest)
81+
82+
if (defaultSourceMapFile.exists()) {
83+
return defaultSourceMapFile
84+
}
85+
86+
if (flavor.empty) {
87+
throw new InvalidUserDataException("Unable to find source map file at: ${defaultSourceMapFile.absolutePath}.")
88+
}
89+
90+
def fallbackSourceMapDest = "build/generated/sourcemaps/react/${flavor}/release/index.android.bundle.map"
91+
def fallbackSourceMapFile = new File(appDir, fallbackSourceMapDest)
92+
93+
project.logger.info "Unable to find source map file at: ${defaultSourceMapFile.absolutePath}.\n" +
94+
"Falling back to ${fallbackSourceMapFile.absolutePath}."
95+
96+
if (!fallbackSourceMapFile.exists()) {
97+
throw new InvalidUserDataException("Unable to find source map file at: ${fallbackSourceMapFile.absolutePath} either.")
98+
}
99+
100+
return fallbackSourceMapFile
101+
}
102+
103+
/**
104+
* Infers the app version to use in source map upload based on the flavor.
105+
* This is needed since different flavors may have different version codes and names (e.g. version suffixes).
106+
*
107+
* It checks the version for the flavor's variant.
108+
* If no variant is found it falls back to the app's default config.
109+
*
110+
*
111+
* @param flavor The flavor to get the app version for.
112+
* @return A map containing the version code and version name.
113+
*/
114+
Map<String, String> getDefaultVersion(String flavor) {
115+
def appProject = project(':app')
116+
def defaultConfig = appProject.android.defaultConfig
117+
118+
def variants = appProject.android.applicationVariants
119+
120+
// uncapitalize is used to turn "Release" into "release" if the flavor is empty
121+
def variantName = "${flavor}Release".uncapitalize()
122+
def variant = variants.find { it.name.uncapitalize() == variantName }
123+
124+
def versionName = variant?.versionName ?: defaultConfig.versionName
125+
def versionCode = variant?.versionCode ?: defaultConfig.versionCode
126+
127+
return [name: "${versionName}", code: "${versionCode}"]
128+
}
129+
83130
boolean isUploadSourcemapsEnabled() {
84131
def envValue = System.getenv('INSTABUG_SOURCEMAPS_UPLOAD_DISABLE')?.toBoolean()
85132
def defaultValue = true

android/src/main/java/com/instabug/reactlibrary/ArgsRegistry.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import com.instabug.library.invocation.InstabugInvocationEvent;
1616
import com.instabug.library.invocation.util.InstabugFloatingButtonEdge;
1717
import com.instabug.library.invocation.util.InstabugVideoRecordingButtonPosition;
18+
import com.instabug.library.sessionreplay.model.SessionMetadata;
1819
import com.instabug.library.ui.onboarding.WelcomeMessage;
1920

2021
import java.util.ArrayList;
@@ -58,6 +59,7 @@ static Map<String, Object> getAll() {
5859
putAll(nonFatalExceptionLevel);
5960
putAll(locales);
6061
putAll(placeholders);
62+
putAll(launchType);
6163
}};
6264
}
6365

@@ -238,4 +240,18 @@ static Map<String, Object> getAll() {
238240
put("team", Key.CHATS_TEAM_STRING_NAME);
239241
put("insufficientContentMessage", Key.COMMENT_FIELD_INSUFFICIENT_CONTENT);
240242
}};
243+
244+
public static ArgsMap<String> launchType = new ArgsMap<String>() {{
245+
put("cold", SessionMetadata.LaunchType.COLD);
246+
put("warm",SessionMetadata.LaunchType.WARM );
247+
put("unknown","unknown");
248+
}};
249+
250+
// Temporary workaround to be removed in future release
251+
// This is used for mapping native `LaunchType` values into React Native enum values.
252+
public static HashMap<String,String> launchTypeReversed = new HashMap<String,String>() {{
253+
put(SessionMetadata.LaunchType.COLD,"cold");
254+
put(SessionMetadata.LaunchType.WARM,"warm" );
255+
}};
256+
241257
}

android/src/main/java/com/instabug/reactlibrary/Constants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ final class Constants {
1212

1313
final static String IBG_ON_NEW_W3C_FLAGS_UPDATE_RECEIVED_CALLBACK = "IBGOnNewW3CFlagsUpdateReceivedCallback";
1414

15+
final static String IBG_SESSION_REPLAY_ON_SYNC_CALLBACK_INVOCATION = "IBGSessionReplayOnSyncCallback";
16+
1517
}

0 commit comments

Comments
 (0)