diff --git a/api/chalicelib/core/users.py b/api/chalicelib/core/users.py index 07e4a1bf1..3c3f68772 100644 --- a/api/chalicelib/core/users.py +++ b/api/chalicelib/core/users.py @@ -457,12 +457,6 @@ def set_password_invitation(user_id, new_password): user = update(tenant_id=-1, user_id=user_id, changes=changes) r = authenticate(user['email'], new_password) - tenant_id = r.pop("tenantId") - r["limits"] = { - "teamMember": -1, - "projects": -1, - "metadata": metadata.get_remaining_metadata_with_count(tenant_id)} - return { "jwt": r.pop("jwt"), "refreshToken": r.pop("refreshToken"), @@ -470,10 +464,7 @@ def set_password_invitation(user_id, new_password): "spotJwt": r.pop("spotJwt"), "spotRefreshToken": r.pop("spotRefreshToken"), "spotRefreshTokenMaxAge": r.pop("spotRefreshTokenMaxAge"), - 'data': { - "scopeState": scope.get_scope(-1), - "user": r - } + **r } diff --git a/api/schemas/schemas.py b/api/schemas/schemas.py index 5aa0b4e5f..8b4e2e317 100644 --- a/api/schemas/schemas.py +++ b/api/schemas/schemas.py @@ -754,6 +754,8 @@ class SessionsSearchPayloadSchema(_TimedSchema, _PaginatedSchema): for f in values.get("filters", []): vals = [] for v in f.get("value", []): + if f.get("type", "") == FilterType.DURATION.value and v is None: + v = 0 if v is not None and (f.get("type", "") != FilterType.DURATION.value or str(v).isnumeric()): vals.append(v) diff --git a/ee/api/chalicelib/core/users.py b/ee/api/chalicelib/core/users.py index 721715a55..96a4f7693 100644 --- a/ee/api/chalicelib/core/users.py +++ b/ee/api/chalicelib/core/users.py @@ -540,12 +540,6 @@ def set_password_invitation(tenant_id, user_id, new_password): user = update(tenant_id=tenant_id, user_id=user_id, changes=changes) r = authenticate(user['email'], new_password) - tenant_id = r.pop("tenantId") - r["limits"] = { - "teamMember": -1, - "projects": -1, - "metadata": metadata.get_remaining_metadata_with_count(tenant_id)} - return { "jwt": r.pop("jwt"), "refreshToken": r.pop("refreshToken"), @@ -554,10 +548,7 @@ def set_password_invitation(tenant_id, user_id, new_password): "spotRefreshToken": r.pop("spotRefreshToken"), "spotRefreshTokenMaxAge": r.pop("spotRefreshTokenMaxAge"), "tenantId": tenant_id, - 'data': { - "scopeState": scope.get_scope(tenant_id), - "user": r - } + **r } diff --git a/frontend/app/api_client.ts b/frontend/app/api_client.ts index 431cea014..a8ac9b3b2 100644 --- a/frontend/app/api_client.ts +++ b/frontend/app/api_client.ts @@ -198,6 +198,11 @@ export default class APIClient { } return fetch(edp + _path, init).then((response) => { + if (response.status === 403) { + console.warn('API returned 403. Clearing JWT token.'); + this.onUpdateJwt({ jwt: undefined }); // Clear the token + } + if (response.ok) { return response; } else { diff --git a/frontend/app/components/Client/Integrations/apiMethods.ts b/frontend/app/components/Client/Integrations/apiMethods.ts index e5115bd13..3924a068b 100644 --- a/frontend/app/components/Client/Integrations/apiMethods.ts +++ b/frontend/app/components/Client/Integrations/apiMethods.ts @@ -35,6 +35,13 @@ export function useIntegration( return initialValues; }, initialData: initialValues, + retry: (failureCount, error) => { + const status = error.status || error.response.status + if (status === 404) { + return false; + } + return failureCount < 4; + } }); const saveMutation = useMutation({ diff --git a/frontend/app/components/Client/Users/components/UserForm/UserForm.tsx b/frontend/app/components/Client/Users/components/UserForm/UserForm.tsx index 9b5b9bd03..2c1ee6e2c 100644 --- a/frontend/app/components/Client/Users/components/UserForm/UserForm.tsx +++ b/frontend/app/components/Client/Users/components/UserForm/UserForm.tsx @@ -18,7 +18,7 @@ function UserForm() { const isSaving = userStore.saving; const user: any = userStore.instance || userStore.initUser(); const roles = roleStore.list - .filter((r) => (r.isProtected ? user.isSuperAdmin : true)) + .filter((r) => (r.protected ? user.isSuperAdmin : true)) .map((r) => ({ label: r.name, value: r.roleId })); const onChangeCheckbox = (e: any) => { diff --git a/frontend/app/mstore/userStore.ts b/frontend/app/mstore/userStore.ts index b188aa768..72dac68b4 100644 --- a/frontend/app/mstore/userStore.ts +++ b/frontend/app/mstore/userStore.ts @@ -88,7 +88,6 @@ class UserStore { get isEnterprise() { return ( this.account?.edition === 'ee' || - this.account?.edition === 'msaas' || this.authStore.authDetails?.edition === 'ee' ); } diff --git a/tracker/tracker-reactnative/android/build.gradle b/tracker/tracker-reactnative/android/build.gradle index ca635ad5c..5cc380103 100644 --- a/tracker/tracker-reactnative/android/build.gradle +++ b/tracker/tracker-reactnative/android/build.gradle @@ -91,7 +91,7 @@ dependencies { //noinspection GradleDynamicVersion implementation("com.facebook.react:react-native:0.20.1") implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - implementation("com.github.openreplay:android-tracker:v1.1.0") + implementation("com.github.openreplay:android-tracker:v1.1.1") } //allprojects { diff --git a/tracker/tracker-reactnative/android/src/main/java/com/openreplay/reactnative/ReactNativeModule.kt b/tracker/tracker-reactnative/android/src/main/java/com/openreplay/reactnative/ReactNativeModule.kt index c75bc7134..758d83978 100644 --- a/tracker/tracker-reactnative/android/src/main/java/com/openreplay/reactnative/ReactNativeModule.kt +++ b/tracker/tracker-reactnative/android/src/main/java/com/openreplay/reactnative/ReactNativeModule.kt @@ -94,6 +94,16 @@ class ReactNativeModule(reactContext: ReactApplicationContext) : OpenReplay.userAnonymousID(userID) } + @ReactMethod + fun getSessionID(promise: Promise) { + try { + val sessionId = OpenReplay.getSessionID() ?: "" + promise.resolve(sessionId) // Resolve the promise with the session ID + } catch (e: Exception) { + promise.reject("GET_SESSION_ID_ERROR", "Failed to retrieve session ID", e) + } + } + @ReactMethod fun networkRequest( url: String, diff --git a/tracker/tracker-reactnative/example/ios/Podfile.lock b/tracker/tracker-reactnative/example/ios/Podfile.lock index 6855602c5..b846d42d7 100644 --- a/tracker/tracker-reactnative/example/ios/Podfile.lock +++ b/tracker/tracker-reactnative/example/ios/Podfile.lock @@ -9,14 +9,14 @@ PODS: - hermes-engine (0.74.0): - hermes-engine/Pre-built (= 0.74.0) - hermes-engine/Pre-built (0.74.0) - - Openreplay (1.0.13): + - Openreplay (1.0.14): - DeviceKit - SWCompression - - openreplay-react-native (0.6.3): + - openreplay-react-native (0.6.6): - DoubleConversion - glog - hermes-engine - - Openreplay + - Openreplay (= 1.0.14) - RCT-Folly (= 2024.01.01.00) - RCTRequired - RCTTypeSafety @@ -1423,8 +1423,8 @@ SPEC CHECKSUMS: fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120 glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2 hermes-engine: 6eae7edb2f563ee41d7c1f91f4f2e57c26d8a5c3 - Openreplay: f016504d94ede93e3fc120b6e09de0f7cf5119e0 - openreplay-react-native: 30eefdc4acfc89a2b19802197f1f3f5ca8b9aea0 + Openreplay: e0b8de0203bbbd8fc161afab77ac370e2cef3d12 + openreplay-react-native: 3382fc4f597052f10ec79c37e872fc83890c1ce4 RCT-Folly: 045d6ecaa59d826c5736dfba0b2f4083ff8d79df RCTDeprecation: 3ca8b6c36bfb302e1895b72cfe7db0de0c92cd47 RCTRequired: 9fc183af555fd0c89a366c34c1ae70b7e03b1dc5 diff --git a/tracker/tracker-reactnative/example/ios/ReactNativeExample.xcodeproj/project.pbxproj b/tracker/tracker-reactnative/example/ios/ReactNativeExample.xcodeproj/project.pbxproj index 844524cf4..7617be730 100644 --- a/tracker/tracker-reactnative/example/ios/ReactNativeExample.xcodeproj/project.pbxproj +++ b/tracker/tracker-reactnative/example/ios/ReactNativeExample.xcodeproj/project.pbxproj @@ -12,8 +12,8 @@ 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; - A9C89E6F305EA4ABA2BA6B7F /* libPods-ReactNativeExample-ReactNativeExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 995B9D07C36D977422505F5A /* libPods-ReactNativeExample-ReactNativeExampleTests.a */; }; - EBAFD9D1D09E38A2BECDEFD7 /* libPods-ReactNativeExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8EC0163FC0C8425357AB645D /* libPods-ReactNativeExample.a */; }; + 8CFDEAD4DCE52688468D5C80 /* libPods-ReactNativeExample-ReactNativeExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5A889A4784F36428D3856494 /* libPods-ReactNativeExample-ReactNativeExampleTests.a */; }; + C7F3F3B67AF0BA29F7DAC50F /* libPods-ReactNativeExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F4C922963FC6C79114841BE6 /* libPods-ReactNativeExample.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -37,14 +37,14 @@ 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = ReactNativeExample/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = ReactNativeExample/main.m; sourceTree = ""; }; 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = ReactNativeExample/PrivacyInfo.xcprivacy; sourceTree = ""; }; - 7BB0FCD1B64639FBF8D415F1 /* Pods-ReactNativeExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeExample.debug.xcconfig"; path = "Target Support Files/Pods-ReactNativeExample/Pods-ReactNativeExample.debug.xcconfig"; sourceTree = ""; }; - 8103F110EFF5DC2086912662 /* Pods-ReactNativeExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeExample.release.xcconfig"; path = "Target Support Files/Pods-ReactNativeExample/Pods-ReactNativeExample.release.xcconfig"; sourceTree = ""; }; + 212B4F1F0ABCF375B1354A0B /* Pods-ReactNativeExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeExample.debug.xcconfig"; path = "Target Support Files/Pods-ReactNativeExample/Pods-ReactNativeExample.debug.xcconfig"; sourceTree = ""; }; + 5A889A4784F36428D3856494 /* libPods-ReactNativeExample-ReactNativeExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ReactNativeExample-ReactNativeExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 6102A46EF47DB7D6762C9A2B /* Pods-ReactNativeExample-ReactNativeExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeExample-ReactNativeExampleTests.release.xcconfig"; path = "Target Support Files/Pods-ReactNativeExample-ReactNativeExampleTests/Pods-ReactNativeExample-ReactNativeExampleTests.release.xcconfig"; sourceTree = ""; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = ReactNativeExample/LaunchScreen.storyboard; sourceTree = ""; }; - 8EC0163FC0C8425357AB645D /* libPods-ReactNativeExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ReactNativeExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 995B9D07C36D977422505F5A /* libPods-ReactNativeExample-ReactNativeExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ReactNativeExample-ReactNativeExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - AD739469FFA81444B053010C /* Pods-ReactNativeExample-ReactNativeExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeExample-ReactNativeExampleTests.release.xcconfig"; path = "Target Support Files/Pods-ReactNativeExample-ReactNativeExampleTests/Pods-ReactNativeExample-ReactNativeExampleTests.release.xcconfig"; sourceTree = ""; }; + 837561A5C741BC8B67930889 /* Pods-ReactNativeExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeExample.release.xcconfig"; path = "Target Support Files/Pods-ReactNativeExample/Pods-ReactNativeExample.release.xcconfig"; sourceTree = ""; }; + EA74B193F79CA13EE3B460C6 /* Pods-ReactNativeExample-ReactNativeExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeExample-ReactNativeExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-ReactNativeExample-ReactNativeExampleTests/Pods-ReactNativeExample-ReactNativeExampleTests.debug.xcconfig"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; - F09A6DCD4D0E7301CE4FEA8F /* Pods-ReactNativeExample-ReactNativeExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeExample-ReactNativeExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-ReactNativeExample-ReactNativeExampleTests/Pods-ReactNativeExample-ReactNativeExampleTests.debug.xcconfig"; sourceTree = ""; }; + F4C922963FC6C79114841BE6 /* libPods-ReactNativeExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ReactNativeExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -52,7 +52,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A9C89E6F305EA4ABA2BA6B7F /* libPods-ReactNativeExample-ReactNativeExampleTests.a in Frameworks */, + 8CFDEAD4DCE52688468D5C80 /* libPods-ReactNativeExample-ReactNativeExampleTests.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -60,7 +60,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - EBAFD9D1D09E38A2BECDEFD7 /* libPods-ReactNativeExample.a in Frameworks */, + C7F3F3B67AF0BA29F7DAC50F /* libPods-ReactNativeExample.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -102,8 +102,8 @@ isa = PBXGroup; children = ( ED297162215061F000B7C4FE /* JavaScriptCore.framework */, - 8EC0163FC0C8425357AB645D /* libPods-ReactNativeExample.a */, - 995B9D07C36D977422505F5A /* libPods-ReactNativeExample-ReactNativeExampleTests.a */, + F4C922963FC6C79114841BE6 /* libPods-ReactNativeExample.a */, + 5A889A4784F36428D3856494 /* libPods-ReactNativeExample-ReactNativeExampleTests.a */, ); name = Frameworks; sourceTree = ""; @@ -142,10 +142,10 @@ BBD78D7AC51CEA395F1C20DB /* Pods */ = { isa = PBXGroup; children = ( - 7BB0FCD1B64639FBF8D415F1 /* Pods-ReactNativeExample.debug.xcconfig */, - 8103F110EFF5DC2086912662 /* Pods-ReactNativeExample.release.xcconfig */, - F09A6DCD4D0E7301CE4FEA8F /* Pods-ReactNativeExample-ReactNativeExampleTests.debug.xcconfig */, - AD739469FFA81444B053010C /* Pods-ReactNativeExample-ReactNativeExampleTests.release.xcconfig */, + 212B4F1F0ABCF375B1354A0B /* Pods-ReactNativeExample.debug.xcconfig */, + 837561A5C741BC8B67930889 /* Pods-ReactNativeExample.release.xcconfig */, + EA74B193F79CA13EE3B460C6 /* Pods-ReactNativeExample-ReactNativeExampleTests.debug.xcconfig */, + 6102A46EF47DB7D6762C9A2B /* Pods-ReactNativeExample-ReactNativeExampleTests.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -157,12 +157,12 @@ isa = PBXNativeTarget; buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ReactNativeExampleTests" */; buildPhases = ( - B27EB351E8EB8A95534E5905 /* [CP] Check Pods Manifest.lock */, + D039EC238FC4B9FDBDAFB800 /* [CP] Check Pods Manifest.lock */, 00E356EA1AD99517003FC87E /* Sources */, 00E356EB1AD99517003FC87E /* Frameworks */, 00E356EC1AD99517003FC87E /* Resources */, - 0B6D5F0DDD38A379DA447FE4 /* [CP] Embed Pods Frameworks */, - C17CBE6AFA79482CB9780184 /* [CP] Copy Pods Resources */, + DD6933155112660ABBFB11CE /* [CP] Embed Pods Frameworks */, + 1038B73ED8C88C8CDF41F1FC /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -178,13 +178,13 @@ isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactNativeExample" */; buildPhases = ( - 6F54764392BBCE44E741F4F8 /* [CP] Check Pods Manifest.lock */, + BB963842CAFBE7B5A629B013 /* [CP] Check Pods Manifest.lock */, 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, - D6A9F078D16C4A462BE27835 /* [CP] Embed Pods Frameworks */, - 3361A9CFA41E8B9D675BF8CC /* [CP] Copy Pods Resources */, + 35D9F844561F84987A5EA09A /* [CP] Embed Pods Frameworks */, + 3862ED11E8450BD142ECCA26 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -267,24 +267,41 @@ shellPath = /bin/sh; shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n"; }; - 0B6D5F0DDD38A379DA447FE4 /* [CP] Embed Pods Frameworks */ = { + 1038B73ED8C88C8CDF41F1FC /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample-ReactNativeExampleTests/Pods-ReactNativeExample-ReactNativeExampleTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample-ReactNativeExampleTests/Pods-ReactNativeExample-ReactNativeExampleTests-resources-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Embed Pods Frameworks"; + name = "[CP] Copy Pods Resources"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample-ReactNativeExampleTests/Pods-ReactNativeExample-ReactNativeExampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample-ReactNativeExampleTests/Pods-ReactNativeExample-ReactNativeExampleTests-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample-ReactNativeExampleTests/Pods-ReactNativeExample-ReactNativeExampleTests-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample-ReactNativeExampleTests/Pods-ReactNativeExample-ReactNativeExampleTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; - 3361A9CFA41E8B9D675BF8CC /* [CP] Copy Pods Resources */ = { + 35D9F844561F84987A5EA09A /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample/Pods-ReactNativeExample-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample/Pods-ReactNativeExample-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample/Pods-ReactNativeExample-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 3862ED11E8450BD142ECCA26 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -301,7 +318,7 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample/Pods-ReactNativeExample-resources.sh\"\n"; showEnvVarsInLog = 0; }; - 6F54764392BBCE44E741F4F8 /* [CP] Check Pods Manifest.lock */ = { + BB963842CAFBE7B5A629B013 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -323,7 +340,7 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - B27EB351E8EB8A95534E5905 /* [CP] Check Pods Manifest.lock */ = { + D039EC238FC4B9FDBDAFB800 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -345,38 +362,21 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - C17CBE6AFA79482CB9780184 /* [CP] Copy Pods Resources */ = { + DD6933155112660ABBFB11CE /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample-ReactNativeExampleTests/Pods-ReactNativeExample-ReactNativeExampleTests-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample-ReactNativeExampleTests/Pods-ReactNativeExample-ReactNativeExampleTests-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample-ReactNativeExampleTests/Pods-ReactNativeExample-ReactNativeExampleTests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - D6A9F078D16C4A462BE27835 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample/Pods-ReactNativeExample-frameworks-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample-ReactNativeExampleTests/Pods-ReactNativeExample-ReactNativeExampleTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample/Pods-ReactNativeExample-frameworks-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample-ReactNativeExampleTests/Pods-ReactNativeExample-ReactNativeExampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample/Pods-ReactNativeExample-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample-ReactNativeExampleTests/Pods-ReactNativeExample-ReactNativeExampleTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -412,7 +412,7 @@ /* Begin XCBuildConfiguration section */ 00E356F61AD99517003FC87E /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = F09A6DCD4D0E7301CE4FEA8F /* Pods-ReactNativeExample-ReactNativeExampleTests.debug.xcconfig */; + baseConfigurationReference = EA74B193F79CA13EE3B460C6 /* Pods-ReactNativeExample-ReactNativeExampleTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -439,7 +439,7 @@ }; 00E356F71AD99517003FC87E /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AD739469FFA81444B053010C /* Pods-ReactNativeExample-ReactNativeExampleTests.release.xcconfig */; + baseConfigurationReference = 6102A46EF47DB7D6762C9A2B /* Pods-ReactNativeExample-ReactNativeExampleTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; COPY_PHASE_STRIP = NO; @@ -463,7 +463,7 @@ }; 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7BB0FCD1B64639FBF8D415F1 /* Pods-ReactNativeExample.debug.xcconfig */; + baseConfigurationReference = 212B4F1F0ABCF375B1354A0B /* Pods-ReactNativeExample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -490,7 +490,7 @@ }; 13B07F951A680F5B00A75B9A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 8103F110EFF5DC2086912662 /* Pods-ReactNativeExample.release.xcconfig */; + baseConfigurationReference = 837561A5C741BC8B67930889 /* Pods-ReactNativeExample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; diff --git a/tracker/tracker-reactnative/example/src/App.tsx b/tracker/tracker-reactnative/example/src/App.tsx index 5d165b9ae..d28e6544b 100644 --- a/tracker/tracker-reactnative/example/src/App.tsx +++ b/tracker/tracker-reactnative/example/src/App.tsx @@ -31,6 +31,11 @@ export default function App() { Openreplay.tracker.setUserID('react-native@connector.me'); }; + const showId = async () => { + const id = await Openreplay.tracker.getSessionID(); + console.log(id, 'test'); + }; + const apiTest = () => { fetch('https://pokeapi.co/api/v2/pokemon/ditto') .then((res) => { @@ -48,6 +53,10 @@ export default function App() { Set Metadata + + Show ID + + event diff --git a/tracker/tracker-reactnative/ios/ReactNative-Bridging-Header.h b/tracker/tracker-reactnative/ios/ReactNative-Bridging-Header.h index dea7ff6bf..b328079ec 100644 --- a/tracker/tracker-reactnative/ios/ReactNative-Bridging-Header.h +++ b/tracker/tracker-reactnative/ios/ReactNative-Bridging-Header.h @@ -1,2 +1,4 @@ #import -#import + +@interface ORTrackerConnectorBridge : NSObject +@end diff --git a/tracker/tracker-reactnative/ios/ReactNativeORConnector.m b/tracker/tracker-reactnative/ios/ReactNativeORConnector.m index 7ebf4025c..b6cec94cc 100644 --- a/tracker/tracker-reactnative/ios/ReactNativeORConnector.m +++ b/tracker/tracker-reactnative/ios/ReactNativeORConnector.m @@ -12,6 +12,8 @@ RCT_EXTERN_METHOD(startSession:(NSString *)projectKey RCT_EXTERN_METHOD(stop) +RCT_EXTERN_METHOD(getSessionID:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) + RCT_EXTERN_METHOD(setMetadata:(NSString *)key value:(NSString *)value) RCT_EXTERN_METHOD(event:(NSString *)name object:(NSString *)object) diff --git a/tracker/tracker-reactnative/ios/ReactNativeORConnector.swift b/tracker/tracker-reactnative/ios/ReactNativeORConnector.swift index 87b6cb2f1..7e84b92b5 100644 --- a/tracker/tracker-reactnative/ios/ReactNativeORConnector.swift +++ b/tracker/tracker-reactnative/ios/ReactNativeORConnector.swift @@ -74,4 +74,10 @@ public class ORTrackerConnector: NSObject { open func networkRequest(_ url: String, method: String, requestJSON: String, responseJSON: String, status: NSNumber, duration: NSNumber) { Openreplay.shared.networkRequest(url: url, method: method, requestJSON: requestJSON, responseJSON: responseJSON, status: Int(truncating: status), duration: UInt64(truncating: duration)) } + + @objc(getSessionID:rejecter:) + open func getSessionID(_ resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) { + let sessionID = Openreplay.shared.getSessionID() + resolve(sessionID) + } } diff --git a/tracker/tracker-reactnative/ios/ReactNativeORInputManager.swift b/tracker/tracker-reactnative/ios/ReactNativeORInputManager.swift index 925b5579f..44cc1a99c 100644 --- a/tracker/tracker-reactnative/ios/ReactNativeORInputManager.swift +++ b/tracker/tracker-reactnative/ios/ReactNativeORInputManager.swift @@ -1,4 +1,5 @@ import Openreplay +import React @objc(RnTrackedInputManager) class RnTrackedInputManager: RCTViewManager { diff --git a/tracker/tracker-reactnative/ios/ReactNativeORSanitizedViewManager.swift b/tracker/tracker-reactnative/ios/ReactNativeORSanitizedViewManager.swift index 50496431b..dc33e9500 100644 --- a/tracker/tracker-reactnative/ios/ReactNativeORSanitizedViewManager.swift +++ b/tracker/tracker-reactnative/ios/ReactNativeORSanitizedViewManager.swift @@ -1,4 +1,5 @@ import Openreplay +import React @objc(RnSanitizedViewManager) class RnSanitizedViewManager: RCTViewManager { diff --git a/tracker/tracker-reactnative/ios/ReactNativeORTouchViewManager.swift b/tracker/tracker-reactnative/ios/ReactNativeORTouchViewManager.swift index 6f6a7105e..10fd3ee0c 100644 --- a/tracker/tracker-reactnative/ios/ReactNativeORTouchViewManager.swift +++ b/tracker/tracker-reactnative/ios/ReactNativeORTouchViewManager.swift @@ -1,4 +1,5 @@ import Openreplay +import React @objc(RnTrackerTouchViewManager) class RnTrackerTouchViewManager: RCTViewManager { diff --git a/tracker/tracker-reactnative/ios/ReactNativeORViewManager.swift b/tracker/tracker-reactnative/ios/ReactNativeORViewManager.swift index 63a077c89..acbd21f21 100644 --- a/tracker/tracker-reactnative/ios/ReactNativeORViewManager.swift +++ b/tracker/tracker-reactnative/ios/ReactNativeORViewManager.swift @@ -1,4 +1,5 @@ import Openreplay +import React @objc(RnTrackerViewManager) class RnTrackerViewManager: RCTViewManager { diff --git a/tracker/tracker-reactnative/openreplay-react-native.podspec b/tracker/tracker-reactnative/openreplay-react-native.podspec index 99fcae904..ddb04f545 100644 --- a/tracker/tracker-reactnative/openreplay-react-native.podspec +++ b/tracker/tracker-reactnative/openreplay-react-native.podspec @@ -19,11 +19,11 @@ Pod::Spec.new do |s| # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0. # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79. if respond_to?(:install_modules_dependencies, true) - s.dependency "Openreplay" + s.dependency "Openreplay", '1.0.14' install_modules_dependencies(s) else s.dependency "React-Core" - s.dependency "Openreplay" + s.dependency "Openreplay", '1.0.14' # Don't install the dependencies when we run `pod install` in the old architecture. if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then @@ -38,7 +38,7 @@ Pod::Spec.new do |s| s.dependency "RCTRequired" s.dependency "RCTTypeSafety" s.dependency "ReactCommon/turbomodule/core" - s.dependency "Openreplay", '1.0.13' + s.dependency "Openreplay", '1.0.14' end end end diff --git a/tracker/tracker-reactnative/package.json b/tracker/tracker-reactnative/package.json index ca2b01364..c455a07c2 100644 --- a/tracker/tracker-reactnative/package.json +++ b/tracker/tracker-reactnative/package.json @@ -1,6 +1,6 @@ { "name": "@openreplay/react-native", - "version": "0.6.5", + "version": "0.6.6", "description": "Openreplay React-native connector for iOS applications", "main": "lib/commonjs/index", "module": "lib/module/index", diff --git a/tracker/tracker-reactnative/src/index.tsx b/tracker/tracker-reactnative/src/index.tsx index f630bf1b6..bb13cd1db 100644 --- a/tracker/tracker-reactnative/src/index.tsx +++ b/tracker/tracker-reactnative/src/index.tsx @@ -33,6 +33,7 @@ interface IORTrackerConnector { projectUrl?: string ) => void; stop: () => void; + getSessionID: () => Promise; setMetadata: (key: string, value: string) => void; event: (name: string, payload?: string) => void; setUserID: (userID: string) => void; diff --git a/tracker/tracker/CHANGELOG.md b/tracker/tracker/CHANGELOG.md index 42d459e84..11a59bdc5 100644 --- a/tracker/tracker/CHANGELOG.md +++ b/tracker/tracker/CHANGELOG.md @@ -1,8 +1,17 @@ -# 15.0.0 +# 15.0.1 + +- update dependencies +- fix for cjs build process + +## 15.0.0 - new webvitals messages source (new msg type) - new structure for string dictionary (new msg type) +## 14.0.14 + +- more improvements for crossdomain iframe tracking + ## 14.0.13 - fixes for restart logic