Skip to content

[pull] main from getsentry:main #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 719 commits into from
Jul 14, 2025
Merged

[pull] main from getsentry:main #1

merged 719 commits into from
Jul 14, 2025

Conversation

pull[bot]
Copy link

@pull pull bot commented Jun 6, 2024

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

Summary by CodeRabbit

Release Notes

  • New Features

    • Added .clang-format and .swiftlint.yml for consistent code formatting.
    • Introduced GitHub workflows for high-risk code detection, sample app builds, CI skip logic, and Expo sample app automation.
    • Added new YAML bug and feature request templates for improved issue reporting.
    • Implemented RNSentryMapConverter for data conversion to React Native writable formats.
    • Introduced RNSentryModuleImpl, RNSentryModule, and related classes for enhanced Android Sentry integration.
    • Added RNSentryOnDrawReporterManager and view classes for Android draw event reporting.
    • Added RNSentryPackage for module and view manager registration.
    • Introduced RNSentryReactFragmentLifecycleTracer for fragment lifecycle tracking.
    • Added replay components: RNSentryReplayMask, RNSentryReplayUnmask, and their managers.
    • Added RNSentryTimeToDisplay for measuring display readiness on Android and iOS.
    • Introduced comprehensive feedback widget components and management system for React Native.
    • Added RNSentryBreadcrumb and RNSentryReplayBreadcrumbConverter for breadcrumb handling and replay conversion.
    • Introduced MobileReplayOptions and mobileReplayIntegration for session replay configuration.
    • Enhanced Sentry Gradle plugin integration with new options and improved error handling.
    • Added scripts and utilities for building, patching, and uploading sourcemaps with better error reporting.
    • Added new integrations including app registry, spotlight, feedback, profiling, and event origin tagging.
    • Added RNSentryVersion class for SDK versioning and identification.
  • Tests

    • Expanded unit and end-to-end tests covering RNSentryModuleImpl, RNSentryOnDrawReporter, RNSentryTimeToDisplay, RNSentryReplayBreadcrumbConverter, RNSentryAppStart, and more.
    • Added tests for breadcrumb processing, replay masking, dependency container, and lifecycle tracers.
    • Introduced Kotlin and Swift test suites for cross-platform validation.
    • Enhanced test infrastructure with mocks and utilities for React Native contexts and lifecycle events.
  • Refactor / Chores

    • Migrated integrations to use @sentry/core imports; removed deprecated integration classes.
    • Restructured project as a monorepo using Lerna and Yarn workspaces.
    • Streamlined GitHub workflows with concurrency controls, caching improvements, and environment variable enhancements.
    • Improved environment variable handling and error reporting in build and upload scripts.
    • Updated TypeScript configurations for module resolution and build consistency.
    • Cleaned ESLint and .gitignore configurations to cover relevant files and directories.
    • Updated package metadata and dependencies to align with new architecture.
    • Enhanced feedback widget styling and integration for better user experience and error handling.

Copy link

coderabbitai bot commented Jul 15, 2024

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This pull request introduces extensive updates and new features across the repository. It adds fresh configuration files (e.g., for code formatting, linting, and package managers), refines GitHub workflows and issue templates, and reorganizes project metadata (e.g., package.json, lerna.json, CONTRIBUTING). Additionally, it implements and enhances native modules for Sentry’s React Native SDK on Android and iOS, updates TypeScript integrations and client options (including feedback and replay functionality), revises build and deployment scripts, and expands the test coverage with new unit tests. Overall, the changes advance the project’s monorepo structure and integration robustness.

Changes

File(s) Change Summary
.clang-format, .craft.yml, .swiftlint.yml, .yarnrc.yml, lerna.json, .vscode/tasks.json New configuration files added/updated for code styling, dependency management, editor tasks, and monorepo management.
.github/**/*, ISSUE_TEMPLATE/*, workflows (buildandtest.yml, e2e.yml, codeql-analysis.yml, release.yml, skip-ci-noauth.yml, sample-application.yml, sample-application-expo.yml, changes-in-high-risk-code.yml, codegen.yml, native-tests.yml, testflight.yml, update-deps.yml) Numerous GitHub workflows enhanced/added; issue and feature templates replaced with YAML versions; CODEOWNERS updated to include new reviewers; new file filters and skip-CI workflows added.
CHANGELOG.md, CONTRIBUTING.md, LICENSE.md, README.md, package.json, packages/core/package.json Repository metadata and documentation reorganized and updated—including rebranding, version resets, monorepo restructuring, dependency management changes, and addition of a detailed migration guide.
Android & iOS native modules (e.g., RNSentryModuleImpl.java, RNSentry.mm, RNSentryRNSScreen.m, new Swift and Objective-C files, replay components) Extensive updates and new additions to native modules for Sentry integration, including error capturing, breadcrumb handling, view hierarchy management, profiling, session replay capabilities, and new React Native view managers for replay masking/unmasking.
TypeScript/JS integrations and feedback modules (e.g., NativeRNSentry.ts, feedback-related files, replay components, client.ts, integrations/*) Updated interfaces and methods for integrations, client options, feedback widget, and replay functionality with new method signatures, additional type definitions, and new integrations such as mobile replay, feedback, app start, and user interaction tracking.
Test suites (Android and iOS test files under RNSentryAndroidTester and RNSentryCocoaTester) Comprehensive new unit tests added to validate SDK initialization, app start, breadcrumbs, on-draw reporters, time-to-display, replay breadcrumb conversion, and other native functionalities.
Build and deployment scripts (e.g., build-tarball.sh, collect-modules.sh, expo-upload-sourcemaps.js, sentry-xcode*.sh, sentry.gradle) New and updated scripts for packaging, sourcemap uploading, Xcode debug file handling, and Sentry auto-upload behavior with improved error handling and environment variable management.
Babel, Jest, miscellaneous (babel.config.js, jest.config.js, misc.ts) Adjustments made to Babel and Jest configurations, improving module transformations and testing settings; refined utility functions and type declarations.

Sequence Diagram(s)

sequenceDiagram
    participant JS as React Native JS
    participant Native as Sentry Native Module
    participant Sdk as Sentry SDK
    JS->>Native: initNativeSdk(options)
    Native->>Sdk: Configure and initialize SDK
    Sdk-->>Native: Acknowledge initialization
    Native-->>JS: Return initialization result
Loading

Poem

Hop along, dear coder friend,
My whiskers twitch with joyful glee,
New configs, workflows, tests transcend,
Native modules now dance merrily,
Feedback, replay, and integrations bloom,
In our monorepo garden, updates loom,
Hoppily coding 'til the bugs meet their doom!


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Join our Discord community for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 20

Outside diff range, codebase verification and nitpick comments (20)
ios/RNSentryReplay.h (1)

2-8: Consider adding documentation for methods.

The interface declaration looks good. However, adding documentation comments for the methods would improve maintainability and provide clarity on their intended usage.

samples/react-native/src/utils.ts (1)

1-7: Function implementation looks good. Consider adding a comment to explain its purpose.

The logWithoutTracing function is well-implemented for its intended purpose. Adding a comment to explain why this function is necessary would enhance clarity for future maintainers.

samples/react-native/Gemfile (1)

7-7: Sort gems alphabetically.

According to rubocop, gems should be sorted alphabetically. Consider placing activesupport before cocoapods.

- gem 'cocoapods', '1.15.2'
  gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
+ gem 'cocoapods', '1.15.2'
Tools
rubocop

[convention] 7-7: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem activesupport should appear before cocoapods.

(Bundler/OrderedGems)

ios/RNSentryBreadcrumb.h (1)

7-13: Consider adding documentation for the interface and methods.

Adding comments to describe the purpose of the RNSentryBreadcrumb class and its methods would improve readability and maintainability. This is especially important for new files.

+/**
+ * RNSentryBreadcrumb provides utility methods for handling Sentry breadcrumbs
+ * in a React Native context.
+ */
@interface RNSentryBreadcrumb : NSObject

/**
 * Converts a dictionary to a SentryBreadcrumb.
 * @param dict The dictionary to convert.
 * @return A SentryBreadcrumb object.
 */
+ (SentryBreadcrumb *)from: (NSDictionary *) dict;

/**
 * Extracts the current screen name from the given dictionary.
 * @param dict The dictionary containing screen information.
 * @return The current screen name, or nil if not available.
 */
+ (NSString *_Nullable) getCurrentScreenFrom: (NSDictionary *) dict;

@end
ios/RNSentryBreadcrumb.m (1)

10-22: Consider handling unexpected level values.

The current implementation defaults to kSentryLevelInfo for any unrecognized level string. Consider logging a warning or handling unexpected values more explicitly to avoid potential issues.

// Example: Log a warning for unexpected level values
else {
    NSLog(@"Unexpected level value: %@", levelString);
    sentryLevel = kSentryLevelInfo;
}
src/js/replay/xhrUtils.ts (1)

42-51: Consider logging errors in _getBodySize.

While the function handles errors gracefully by returning undefined, consider logging the error to aid in debugging potential issues with response parsing.

// Example: Log an error message
catch (error) {
  console.error('Error parsing response body size:', error);
  return undefined;
}
src/js/replay/networkUtils.ts (2)

17-49: Consider handling additional body types and review error handling.

The function currently does not handle ArrayBufferView or ReadableStream. Consider implementing these for completeness. The try-catch block is appropriate for handling potential errors, but ensure that any exceptions are logged or handled appropriately elsewhere in the application.


59-63: Be aware of serialization limitations with FormData.

The current serialization method using URLSearchParams does not handle File entries correctly. This is acceptable for the current use case, but be cautious if File entries need to be supported in the future.

samples/expo/utils/setScopeProperties.ts (1)

79-84: Consider reducing logging verbosity.

The addition of multiple console logging statements can be useful for debugging, but excessive logging may clutter the console output. Consider using a logging library with configurable log levels to control the verbosity.

samples/react-native/src/setScopeProperties.ts (1)

79-84: Consider reducing logging verbosity.

The addition of multiple console logging statements can be useful for debugging, but excessive logging may clutter the console output. Consider using a logging library with configurable log levels to control the verbosity.

ios/RNSentryReplay.m (1)

9-20: Consider using a more robust logging mechanism.

The use of NSLog for logging is straightforward but consider using a more robust logging framework that can provide different log levels and better control over log output.

samples/react-native/src/Screens/PlaygroundScreen.tsx (3)

1-15: Optimize imports.

Consider grouping similar imports together for better readability. For example, group all React imports together and all React Native imports together.

import * as React from 'react';
import {
  View,
  StyleSheet,
  Text,
  TextInput,
  Image,
  ImageBackground,
  TouchableWithoutFeedback,
  KeyboardAvoidingView,
  Keyboard,
  ScrollView,
  SafeAreaView,
  Pressable,
} from 'react-native';
import SvgGraphic from '../components/SvgGraphic';

26-77: Consider adding error handling for console logs.

While console.log is useful for debugging, consider using a logging library or mechanism that can handle errors more gracefully in production environments.

Pressable
  onPress={event => {
    event.stopPropagation();
    event.preventDefault();
    console.log('Pressable pressed');
  }}>

81-102: Improve style consistency.

Ensure that all styles are consistently named and used. For example, the backgroundImageContainer style is defined but not used anywhere.

const styles = StyleSheet.create({
  space: {
    marginBottom: 50,
  },
  container: {
    padding: 5,
    flex: 1,
  },
  image: {
    width: 200,
    height: 200,
  },
  textInputStyle: {
    height: 200,
    borderColor: 'gray',
    borderWidth: 1,
  },
});
test/tools/sentryBabelTransformer.test.ts (3)

21-24: Clear all mocks in afterEach for consistency.

Consider using afterEach to clear mocks to ensure each test starts with a clean slate, which can help prevent state leakage between tests.

afterEach(() => {
  jest.clearAllMocks();
});

65-86: Improve test coverage for edge cases.

Consider adding more test cases to cover additional edge cases, such as when the filename is null or undefined, to ensure robustness.

test.each([
  // Existing cases
  [
    {
      filename: 'node_modules/file',
      plugins: [jest.fn()],
    } as BabelTransformerArgs,
  ],
  [
    {
      filename: 'project/node_modules/file',
      plugins: [jest.fn()],
    } as BabelTransformerArgs,
  ],
  // New edge case
  [
    {
      filename: null,
      plugins: [jest.fn()],
    } as BabelTransformerArgs,
  ],
])('transform does not add plugin if filename includes node_modules', input => {
  SentryBabelTransformer.transform?.(input);

  expect(MockDefaultBabelTransformer.transform).toHaveBeenCalledTimes(1);
  expect(MockDefaultBabelTransformer.transform).toHaveBeenCalledWith({
    filename: input.filename,
    plugins: expect.not.arrayContaining([expect.objectContaining({ name: 'componentNameAnnotatePlugin' })]),
  });
});

1-5: Enhance fs.readFileSync Mock Implementation

The mock for fs.readFileSync in test/tools/sentryBabelTransformer.test.ts should be enhanced to return realistic data that matches the expected content in the test files. This will ensure that tests relying on specific file contents can execute correctly.

  • Consider returning strings that simulate the content of configuration files or other text-based data expected by the tests.
Analysis chain

Ensure mock implementation is comprehensive.

The mock for fs.readFileSync should include a return value or behavior that simulates real-world usage more closely, especially if other tests depend on it.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `fs.readFileSync` in the codebase to ensure it is mocked correctly.

# Test: Search for `fs.readFileSync` usage. Expect: Comprehensive mock coverage.
rg --type js 'fs.readFileSync'

Length of output: 891


Script:

#!/bin/bash
# Description: Search for the usage of `fs.readFileSync` in test files to understand expected behavior.

# Test: Search for `fs.readFileSync` usage in test files.
rg --type js 'fs.readFileSync' test/

Length of output: 556

android/src/main/java/io/sentry/react/RNSentryBreadcrumb.java (1)

15-33: Ensure comprehensive error handling in getCurrentScreenFrom.

The method currently catches Throwable, which is too broad. Consider catching specific exceptions to avoid masking other issues.

try {
  // getString might throw if cast to string fails (data.to is not enforced by TS to be a string)
  return maybeData.hasKey("to") ? maybeData.getString("to") : null;
} catch (ClassCastException exception) {
  return null;
}
test/replay/xhrUtils.test.ts (1)

5-71: Consider adding an edge case test for invalid xhr hint.

To further enhance test coverage, consider adding a test case where the xhr hint is invalid or malformed to ensure the function handles such cases gracefully.

samples/react-native/src/components/SvgGraphic.tsx (1)

5-286: Consider optimizing the SVG content.

The SVG content appears to be auto-generated. Consider optimizing it for performance and maintainability by removing unnecessary attributes or simplifying paths where possible.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between fada0cd and 764654b.

Files ignored due to path filters (4)
  • samples/expo/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
  • samples/react-native/Gemfile.lock is excluded by !**/*.lock
  • samples/react-native/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
Files selected for processing (102)
  • .github/workflows/codeql-analysis.yml (3 hunks)
  • .github/workflows/e2e.yml (9 hunks)
  • .github/workflows/native-tests.yml (3 hunks)
  • .github/workflows/sample-application.yml (2 hunks)
  • .gitignore (1 hunks)
  • CHANGELOG.md (7 hunks)
  • RNSentry.podspec (1 hunks)
  • RNSentryAndroidTester/app/src/test/java/io/sentry/rnsentryandroidtester/RNSentryBreadcrumbTest.kt (1 hunks)
  • RNSentryAndroidTester/app/src/test/java/io/sentry/rnsentryandroidtester/RNSentryReplayBreadcrumbConverterTest.kt (1 hunks)
  • RNSentryCocoaTester/RNSentryCocoaTester.xcodeproj/project.pbxproj (9 hunks)
  • RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryBreadcrumbTests.swift (1 hunks)
  • RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryCocoaTesterTests-Bridging-Header.h (1 hunks)
  • RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryReplayBreadcrumbConverterTests.swift (1 hunks)
  • android/build.gradle (1 hunks)
  • android/src/main/java/io/sentry/react/RNSentryBreadcrumb.java (1 hunks)
  • android/src/main/java/io/sentry/react/RNSentryModuleImpl.java (12 hunks)
  • android/src/main/java/io/sentry/react/RNSentryReplayBreadcrumbConverter.java (1 hunks)
  • android/src/newarch/java/io/sentry/react/RNSentryModule.java (1 hunks)
  • android/src/oldarch/java/io/sentry/react/RNSentryModule.java (1 hunks)
  • ios/RNSentry.mm (11 hunks)
  • ios/RNSentryBreadcrumb.h (1 hunks)
  • ios/RNSentryBreadcrumb.m (1 hunks)
  • ios/RNSentryReplay.h (1 hunks)
  • ios/RNSentryReplay.m (1 hunks)
  • ios/RNSentryReplayBreadcrumbConverter.h (1 hunks)
  • ios/RNSentryReplayBreadcrumbConverter.m (1 hunks)
  • package.json (3 hunks)
  • samples/expo/app.json (2 hunks)
  • samples/expo/app/_layout.tsx (2 hunks)
  • samples/expo/babel.config.js (1 hunks)
  • samples/expo/metro.config.js (1 hunks)
  • samples/expo/package.json (2 hunks)
  • samples/expo/utils/setScopeProperties.ts (1 hunks)
  • samples/react-native/Gemfile (1 hunks)
  • samples/react-native/android/app/build.gradle (1 hunks)
  • samples/react-native/android/app/src/main/java/io/sentry/reactnative/sample/MainApplication.kt (2 hunks)
  • samples/react-native/babel.config.js (1 hunks)
  • samples/react-native/ios/sentryreactnativesample.xcodeproj/project.pbxproj (6 hunks)
  • samples/react-native/ios/sentryreactnativesample/AppDelegate.mm (1 hunks)
  • samples/react-native/ios/sentryreactnativesample/Info.plist (1 hunks)
  • samples/react-native/ios/sentryreactnativesample/PrivacyInfo.xcprivacy (1 hunks)
  • samples/react-native/ios/sentryreactnativesampleTests/Info.plist (1 hunks)
  • samples/react-native/metro.config.js (1 hunks)
  • samples/react-native/package.json (3 hunks)
  • samples/react-native/src/App.tsx (6 hunks)
  • samples/react-native/src/Screens/PlaygroundScreen.tsx (1 hunks)
  • samples/react-native/src/Screens/TrackerScreen.tsx (2 hunks)
  • samples/react-native/src/components/SvgGraphic.tsx (1 hunks)
  • samples/react-native/src/setScopeProperties.ts (1 hunks)
  • samples/react-native/src/utils.ts (1 hunks)
  • scripts/expo-upload-sourcemaps.js (2 hunks)
  • scripts/sentry-xcode-debug-files.sh (1 hunks)
  • scripts/sentry-xcode.sh (1 hunks)
  • scripts/update-javascript.sh (1 hunks)
  • sentry.gradle (1 hunks)
  • src/js/NativeRNSentry.ts (3 hunks)
  • src/js/client.ts (5 hunks)
  • src/js/integrations/debugsymbolicator.ts (5 hunks)
  • src/js/integrations/default.ts (4 hunks)
  • src/js/integrations/exports.ts (2 hunks)
  • src/js/integrations/index.ts (1 hunks)
  • src/js/misc.ts (1 hunks)
  • src/js/options.ts (2 hunks)
  • src/js/replay/mobilereplay.ts (1 hunks)
  • src/js/replay/networkUtils.ts (1 hunks)
  • src/js/replay/xhrUtils.ts (1 hunks)
  • src/js/tools/enableLogger.ts (1 hunks)
  • src/js/tools/metroconfig.ts (4 hunks)
  • src/js/tools/sentryBabelTransformer.ts (1 hunks)
  • src/js/tools/sentryBabelTransformerUtils.ts (1 hunks)
  • src/js/tools/vendor/metro/metroBabelTransformer.ts (1 hunks)
  • src/js/touchevents.tsx (8 hunks)
  • src/js/tracing/nativeframes.ts (9 hunks)
  • src/js/tracing/reactnativeprofiler.tsx (2 hunks)
  • src/js/tracing/reactnativetracing.ts (11 hunks)
  • src/js/tracing/timetodisplay.tsx (4 hunks)
  • src/js/tracing/utils.ts (2 hunks)
  • src/js/utils/clientutils.ts (1 hunks)
  • src/js/utils/environment.ts (1 hunks)
  • src/js/utils/error.ts (1 hunks)
  • src/js/utils/rnlibraries.ts (2 hunks)
  • src/js/utils/rnlibrariesinterface.ts (2 hunks)
  • src/js/utils/worldwide.ts (1 hunks)
  • src/js/vendor/react-native/index.ts (1 hunks)
  • src/js/version.ts (1 hunks)
  • src/js/wrapper.ts (6 hunks)
  • test/client.test.ts (8 hunks)
  • test/integrations/debugsymbolicator.test.ts (2 hunks)
  • test/misc.test.ts (2 hunks)
  • test/perf/metrics-ios.yml (1 hunks)
  • test/react-native/rn.patch.metro.config.js (2 hunks)
  • test/replay/networkUtils.test.ts (1 hunks)
  • test/replay/xhrUtils.test.ts (1 hunks)
  • test/tools/fixtures/mockBabelTransformer.js (1 hunks)
  • test/tools/metroconfig.test.ts (1 hunks)
  • test/tools/sentryBabelTransformer.test.ts (1 hunks)
  • test/touchevents.test.tsx (4 hunks)
  • test/tracing/nativeframes.test.ts (1 hunks)
  • test/tracing/reactnativetracing.test.ts (11 hunks)
  • test/tracing/reactnavigation.ttid.test.tsx (1 hunks)
  • test/tracing/timetodisplay.test.tsx (1 hunks)
  • test/wrapper.test.ts (7 hunks)
Files skipped from review due to trivial changes (8)
  • .github/workflows/codeql-analysis.yml
  • .gitignore
  • RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryCocoaTesterTests-Bridging-Header.h
  • samples/expo/babel.config.js
  • samples/react-native/ios/sentryreactnativesampleTests/Info.plist
  • src/js/tools/enableLogger.ts
  • src/js/utils/rnlibrariesinterface.ts
  • test/tools/fixtures/mockBabelTransformer.js
Additional context used
rubocop
samples/react-native/Gemfile

[convention] 7-7: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem activesupport should appear before cocoapods.

(Bundler/OrderedGems)

Biome
src/js/tools/sentryBabelTransformer.ts

[error] 32-32: The function should not return a value because its return type is void.

The function is here:

'void' signals the absence of value. The returned value is likely to be ignored by the caller.

(lint/correctness/noVoidTypeReturn)

src/js/tracing/reactnativeprofiler.tsx

[error] 19-19: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 20-20: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

src/js/replay/networkUtils.ts

[error] 11-11: isNaN is unsafe. It attempts a type coercion. Use Number.isNaN instead.

See the MDN documentation for more details.
Unsafe fix: Use Number.isNaN instead.

(lint/suspicious/noGlobalIsNan)

test/tools/metroconfig.test.ts

[error] 90-90: void is confusing inside a union type.

Unsafe fix: Use undefined instead.

(lint/suspicious/noConfusingVoidType)

src/js/replay/mobilereplay.ts

[error] 81-81: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

src/js/tools/metroconfig.ts

[error] 103-103: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

src/js/client.ts

[error] 75-75: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

test/tracing/reactnativetracing.test.ts

[error] 1266-1266: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


[error] 1267-1267: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

SwiftLint
RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryBreadcrumbTests.swift

[Error] 21-21: Force casts should be avoided

(force_cast)

RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryReplayBreadcrumbConverterTests.swift

[Error] 21-21: Force casts should be avoided

(force_cast)


[Error] 22-22: Force casts should be avoided

(force_cast)


[Error] 23-23: Force casts should be avoided

(force_cast)


[Error] 25-25: Force casts should be avoided

(force_cast)


[Error] 26-26: Force casts should be avoided

(force_cast)


[Error] 27-27: Force casts should be avoided

(force_cast)


[Error] 28-28: Force casts should be avoided

(force_cast)


[Error] 45-45: Force casts should be avoided

(force_cast)


[Error] 46-46: Force casts should be avoided

(force_cast)


[Error] 47-47: Force casts should be avoided

(force_cast)


[Error] 49-49: Force casts should be avoided

(force_cast)


[Error] 50-50: Force casts should be avoided

(force_cast)


[Error] 52-52: Force casts should be avoided

(force_cast)


[Error] 65-65: Force casts should be avoided

(force_cast)


[Error] 66-66: Force casts should be avoided

(force_cast)


[Error] 68-68: Force casts should be avoided

(force_cast)


[Error] 81-81: Force casts should be avoided

(force_cast)


[Error] 82-82: Force casts should be avoided

(force_cast)


[Error] 84-84: Force casts should be avoided

(force_cast)


[Error] 120-120: Force casts should be avoided

(force_cast)


[Error] 121-121: Force casts should be avoided

(force_cast)


[Error] 122-122: Force casts should be avoided

(force_cast)


[Error] 124-124: Force casts should be avoided

(force_cast)


[Error] 125-125: Force casts should be avoided

(force_cast)


[Error] 130-130: Force casts should be avoided

(force_cast)


[Error] 176-176: Force casts should be avoided

(force_cast)


[Error] 177-177: Force casts should be avoided

(force_cast)


[Error] 178-178: Force casts should be avoided

(force_cast)


[Error] 179-179: Force casts should be avoided

(force_cast)


[Error] 179-179: Force casts should be avoided

(force_cast)


[Error] 180-180: Force casts should be avoided

(force_cast)


[Warning] 66-66: Lines should not have trailing semicolons

(trailing_semicolon)


[Warning] 82-82: Lines should not have trailing semicolons

(trailing_semicolon)


[Warning] 135-135: Lines should not have trailing semicolons

(trailing_semicolon)


[Warning] 140-140: Lines should not have trailing semicolons

(trailing_semicolon)


[Warning] 146-146: Lines should not have trailing semicolons

(trailing_semicolon)


[Warning] 159-159: Lines should not have trailing semicolons

(trailing_semicolon)


[Warning] 172-172: Lines should not have trailing semicolons

(trailing_semicolon)

Additional comments not posted (186)
src/js/version.ts (1)

3-3: Version update approved.

The update to the SDK version number is appropriate and necessary for tracking changes and ensuring compatibility.

samples/react-native/Gemfile (1)

7-7: Update to activesupport version constraint.

The version constraint has been updated to >= 6.1.7.5, which likely includes important bug fixes or improvements.

Tools
rubocop

[convention] 7-7: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem activesupport should appear before cocoapods.

(Bundler/OrderedGems)

samples/react-native/babel.config.js (1)

12-12: Addition of react-native-reanimated/plugin.

The plugin has been added to enhance animation capabilities in the project, allowing for smoother and more complex animations.

test/perf/metrics-ios.yml (2)

9-9: Adjust startupTimeTest threshold.

The diffMin threshold has been lowered to -20, allowing for more variation in startup time. This indicates a shift in performance expectations.

Ensure that this change aligns with the overall performance goals of the application.


13-14: Adjust binarySizeTest thresholds.

The diffMin and diffMax thresholds have been increased to 600 KiB and 1000 KiB, respectively. This allows for larger binary sizes without failing the test.

Verify that these changes are acceptable given the application's requirements and constraints.

scripts/update-javascript.sh (1)

6-6: Verify the impact of removing @sentry/hub from packages.

Ensure that the removal of @sentry/hub from the packages array does not negatively impact the project. Check if any other scripts or configurations depend on this package.

src/js/utils/clientutils.ts (1)

8-10: LGTM! Consider adding more utility functions.

The hasHooks function is well-implemented using TypeScript type guards. If there are other common checks or utilities needed for Sentry clients, consider adding them to this file to centralize utility functions.

ios/RNSentryReplayBreadcrumbConverter.h (5)

1-1: Ensure the correct import statement.

The @import Sentry; statement is used to import the Sentry framework. Ensure that the framework is correctly configured in the project settings to avoid compilation issues.


3-3: Conditional compilation directive.

The use of #if SENTRY_TARGET_REPLAY_SUPPORTED is appropriate for conditionally compiling code based on the target's capabilities. Ensure that this macro is defined correctly in the build settings.


6-7: Interface definition looks good.

The RNSentryReplayBreadcrumbConverter interface correctly implements the SentryReplayBreadcrumbConverter protocol. Ensure that all required methods from the protocol are implemented.


11-11: Clarify nullability annotations.

The method getTouchPathMessageFrom uses _Nullable for its return type and parameter. Ensure that nullability is correctly handled in the implementation to prevent runtime issues.


13-13: Check method conversion logic.

The method convertFrom should correctly convert a SentryBreadcrumb to an SentryRRWebEvent. Ensure that the conversion logic is implemented correctly in the corresponding .m file.

src/js/misc.ts (2)

8-9: Documentation clarity improved.

The updated documentation clarifies that hard crashes are only unhandled errors, excluding user-set unhandled mechanisms. This improves the understanding of the function's purpose.


15-15: Logic refinement enhances accuracy.

The refined logic in isHardCrash now specifically checks for unhandled exceptions with a mechanism type of 'onerror'. This change improves the accuracy of crash detection.

src/js/integrations/index.ts (1)

17-17: New export added successfully.

The addition of mobileReplayIntegration expands the module's interface, making mobile replay features available for import elsewhere in the application. Ensure that this integration is correctly implemented and documented in the mobilereplay module.

src/js/utils/worldwide.ts (2)

25-27: Addition of optional properties to the interface.

The new properties __BUNDLE_START_TIME__, nativePerformanceNow, and TextEncoder are added to the ReactNativeInternalGlobal interface. These properties enhance the interface's capabilities and align with modern JavaScript features.


30-33: Definition of TextEncoder type.

The TextEncoder type is defined with a constructor and an encode method. This addition is useful for text encoding functionalities in environments where the native TextEncoder might not be available.

samples/expo/package.json (2)

3-3: Version update to 5.27.0.

The version number has been incremented from 5.22.3 to 5.27.0, indicating a new release. Ensure that the changelog and documentation reflect this update.


36-36: Addition of @sentry/babel-plugin-component-annotate to devDependencies.

The new dependency @sentry/babel-plugin-component-annotate is added with version ^2.18.0. This addition likely improves error tracking or performance monitoring during development.

src/js/integrations/exports.ts (2)

15-15: Export of mobileReplayIntegration.

The mobileReplayIntegration is newly exported from ../replay/mobilereplay. This addition enhances the module's integration capabilities for mobile replay functionalities.


28-28: Renaming of replayIntegration to browserReplayIntegration.

The replayIntegration is now exported as browserReplayIntegration. This renaming clarifies the context in which the integration is used, improving modularity and usability.

src/js/utils/error.ts (1)

3-3: Enhancement approved: Added cause property to ExtendedError.

The addition of the cause property provides valuable context for debugging without altering existing functionality.

samples/expo/app.json (1)

7-7: Version and build number updates approved.

The version increment from 5.22.3 to 5.27.0 and build number updates are consistent with the introduction of new features or enhancements.

Also applies to: 22-22, 30-30

src/js/utils/rnlibraries.ts (1)

3-3: Improvement approved: Dynamic React Native version retrieval.

The update to use Platform.constants?.reactNativeVersion enhances flexibility in version management.

Also applies to: 34-34

samples/react-native/ios/sentryreactnativesample/Info.plist (1)

20-24: Version and build number updated.

The updates to CFBundleShortVersionString and CFBundleVersion reflect a new version and build number for the application. These changes are appropriate for a new release.

src/js/tools/sentryBabelTransformer.ts (1)

1-43: Babel transformer setup is well-implemented.

The setup for creating a Sentry Babel transformer using a component annotation plugin is clear and follows best practices. The use of the spread operator and conditional plugin addition is effective.

Tools
Biome

[error] 32-32: The function should not return a value because its return type is void.

The function is here:

'void' signals the absence of value. The returned value is likely to be ignored by the caller.

(lint/correctness/noVoidTypeReturn)

android/build.gradle (1)

57-57: Sentry Android SDK version updated.

The update from version 7.8.0 to 7.13.0 for the Sentry Android SDK is a standard version increment that likely includes new features and improvements.

test/misc.test.ts (2)

33-47: New test case added: LGTM!

The new test case "handled false outside of onerror is not a hard crash" effectively verifies the expected behavior of the isHardCrash function when exceptions are not tied to the "onerror" mechanism. This improves test coverage.


58-58: Modification in existing test case: LGTM!

The change in the type from 'test' to 'onerror' in the "any handled false is a hard crash" test case ensures that the function behaves correctly when exceptions are associated with the "onerror" mechanism.

ios/RNSentryBreadcrumb.m (1)

33-49: LGTM!

The getCurrentScreenFrom method correctly extracts the current screen from the dictionary, ensuring type safety and appropriate null checks.

src/js/replay/xhrUtils.ts (1)

10-35: Enriching XHR breadcrumbs: LGTM!

The function enrichXhrBreadcrumbsForMobileReplay effectively enhances breadcrumbs with additional data, ensuring that only relevant XHR requests are processed.

samples/expo/metro.config.js (1)

12-12: Configuration Enhancement Approved.

The addition of annotateReactComponents: true in the getSentryExpoConfig function enhances the integration with Sentry by enabling React component annotations. This change is beneficial for error tracking and performance monitoring.

RNSentryAndroidTester/app/src/test/java/io/sentry/rnsentryandroidtester/RNSentryBreadcrumbTest.kt (1)

1-66: Unit Tests Approved.

The unit tests for RNSentryBreadcrumb.getCurrentScreenFrom are comprehensive and cover various edge cases, ensuring robust validation of the method's behavior. The use of JUnit for assertions is appropriate.

test/replay/networkUtils.test.ts (1)

1-58: Unit Tests Approved.

The unit tests for networkUtils functions parseContentLengthHeader and getBodySize are thorough and cover a wide range of scenarios. The use of Jest for testing is appropriate and ensures the functions handle various input types correctly.

test/react-native/rn.patch.metro.config.js (2)

40-45: Ensure consistent application of sentryOptions.

The sentryOptions should be consistently applied across the configuration. Ensure that the logic correctly appends the options in both the withSentryConfig call and the module.exports line.


47-51: Verify compatibility with React Native versions below 0.72.

The addition of babelTransformerPath for React Native versions below 0.72 is a good compatibility measure. Ensure that this change is tested with older versions to confirm its effectiveness.

src/js/tracing/reactnativeprofiler.tsx (1)

1-2: New imports enhance functionality.

The added imports for getClient and timestampInSeconds improve the integration with Sentry's client and timestamp handling.

samples/react-native/metro.config.js (1)

63-65: Enhance Sentry integration with component annotation.

The addition of annotateReactComponents: true improves the tracking and error reporting of React components, enhancing the application's debugging capabilities.

src/js/replay/networkUtils.ts (1)

52-57: LGTM!

The _encode function correctly uses TextEncoder and provides a fallback.

RNSentry.podspec (1)

36-36: Verify compatibility with updated Sentry/HybridSDK.

The version update to 8.32.0 may introduce changes. Ensure compatibility with other dependencies and test the integration thoroughly.

scripts/sentry-xcode-debug-files.sh (1)

38-47: LGTM! Enhanced error handling and output management.

The changes improve the script's robustness by capturing command output and providing detailed error messages. This makes it easier to diagnose issues during the upload process.

scripts/sentry-xcode.sh (1)

26-35: LGTM! Enhanced error handling and output reporting.

The changes improve the robustness and user feedback of the script by capturing command output and handling errors effectively. The use of set +x +e helps prevent logging sensitive information.

samples/react-native/ios/sentryreactnativesample/PrivacyInfo.xcprivacy (1)

1-72: LGTM! Privacy configurations are well-defined.

The privacy access and data collection settings align with typical configurations for managing application privacy.

src/js/tools/sentryBabelTransformerUtils.ts (1)

11-65: Overall structure and error handling look good.

The functions for managing the Babel transformer path are well-structured, and error handling is appropriately managed. The use of try-catch blocks ensures that errors are logged without interrupting the process.

src/js/tools/vendor/metro/metroBabelTransformer.ts (1)

1-64: Conforms to TypeScript conventions.

The TypeScript interfaces and types are well-defined and align with typical TypeScript conventions. Ensure that any modifications to this vendor file are necessary and documented.

samples/react-native/package.json (1)

Line range hint 3-48:
Verify compatibility with updated dependencies.

The version updates and new dependencies should be tested to ensure compatibility and functionality within the project. Ensure that the updated dependencies do not introduce breaking changes.

test/tools/sentryBabelTransformer.test.ts (1)

33-53: Verify plugin addition logic.

Ensure that the logic for adding the componentNameAnnotatePlugin is correct and that it does not interfere with other plugins. Consider adding more assertions to verify the order and presence of plugins.

test/replay/xhrUtils.test.ts (1)

5-71: Comprehensive test coverage for enrichXhrBreadcrumbsForMobileReplay.

The test cases are well-structured and cover a range of scenarios effectively.

src/js/vendor/react-native/index.ts (1)

68-76: New type ReactNativeVersion enhances type safety.

The type definition is clear and aligns with the versioning structure of React Native.

Consider verifying where and how this type is utilized to ensure consistency across the codebase.

Verification successful

Verification Successful: ReactNativeVersion is Consistently Used Across the Codebase

The ReactNativeVersion type is utilized in multiple files, indicating its integration and consistent usage, which aligns with the review comment's assertion of enhanced type safety.

  • src/js/utils/rnlibrariesinterface.ts
  • src/js/utils/rnlibraries.ts
  • src/js/utils/environment.ts
  • src/js/integrations/reactnativeinfo.ts
  • test/integrations/reactnativeinfo.test.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `ReactNativeVersion` type in the codebase.

# Test: Search for the usage of `ReactNativeVersion`. Expect: Occurrences where the type is used.
rg --type typescript 'ReactNativeVersion'

Length of output: 76


Script:

#!/bin/bash
# Description: Verify the usage of `ReactNativeVersion` type in the codebase.

# Test: Search for the usage of `ReactNativeVersion`. Expect: Occurrences where the type is used.
rg --type ts 'ReactNativeVersion'

Length of output: 983

src/js/utils/environment.ts (1)

61-69: New functions isMobileOs and notMobileOs improve platform detection.

The functions are well-implemented and provide clear distinctions between mobile and non-mobile platforms.

Consider verifying where these functions are used to ensure they are integrated effectively within the codebase.

samples/react-native/android/app/src/main/java/io/sentry/reactnative/sample/MainApplication.kt (1)

14-18: Imports look good.

The added imports are necessary for the Sentry integration.

samples/react-native/ios/sentryreactnativesample/AppDelegate.mm (1)

11-12: Imports look good.

The added imports are necessary for the Sentry integration.

src/js/tracing/utils.ts (2)

9-10: Imports look good.

The addition of the logger is appropriate for enhancing logging capabilities.


122-137: Function implementation looks good.

The getBundleStartTimestampMs function is well-implemented, correctly handling different scenarios and logging appropriately.

samples/react-native/src/Screens/TrackerScreen.tsx (2)

Line range hint 14-109:
Refactoring improves readability and maintainability.

The extraction of the TrackerTitle component and the removal of console logs enhance the code's clarity and maintainability without altering its functionality.


112-116: Well-structured component.

The TrackerTitle component is a clean and effective way to separate title logic, following React best practices.

android/src/newarch/java/io/sentry/react/RNSentryModule.java (2)

162-165: Delegated functionality aligns with existing patterns.

The captureReplay method appropriately delegates functionality. Ensure the internal implementation handles errors correctly.


167-170: Simple getter method.

The getCurrentReplayId method is a straightforward getter. Ensure the internal implementation correctly returns the replay ID.

Verification successful

Internal Implementation Verified

The getCurrentReplayId method in RNSentryModuleImpl correctly handles the retrieval of the replay ID by checking for a null scope and returning null if necessary. This ensures that the method behaves as expected in different scenarios.

  • RNSentryModuleImpl correctly implements getCurrentReplayId.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the return value of the `getCurrentReplayId` method's internal implementation.

# Test: Search for the internal implementation of `getCurrentReplayId`.
ast-grep --lang java --pattern $'class RNSentryModuleImpl {
  $$$
  String getCurrentReplayId() {
    $$$
  }
  $$$
}'

Length of output: 119


Script:

#!/bin/bash
# Search for the class definition of RNSentryModuleImpl
rg 'class RNSentryModuleImpl' --glob '**/*.java' -A 5

# Search for any method named getCurrentReplayId in the codebase
rg 'String getCurrentReplayId' --glob '**/*.java' -A 5

Length of output: 1995

samples/expo/app/_layout.tsx (2)

19-19: Log suppression using LogBox.

Suppressing logs can reduce clutter but may hide important warnings. Ensure this aligns with the project's logging strategy.


84-85: Sentry configuration changes for session replay.

The changes suggest a shift in session replay management. Verify that these changes align with the desired behavior.

Verification successful

Sentry configuration changes verified.

The changes to the Sentry configuration, specifically the shift from replaysOnErrorSampleRate to replaysSessionSampleRate, appear to be intentional and align with the configurable setup for Sentry. The options are defined and used consistently across the codebase.

  • src/js/options.ts: Defines both replaysSessionSampleRate and replaysOnErrorSampleRate.
  • src/js/replay/mobilereplay.ts: Comments indicate these are to be passed to Sentry.init.
  • src/js/integrations/default.ts: Uses both options, suggesting a flexible configuration.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the intention behind the Sentry configuration changes.

# Test: Search for documentation or comments related to Sentry configuration changes.
rg --type markdown --type txt --type js --type ts "Sentry configuration"

Length of output: 420


Script:

#!/bin/bash
# Search for references to replaysSessionSampleRate in the codebase
rg "replaysSessionSampleRate" --type js --type ts --type jsx --type tsx

# Search for references to replaysOnErrorSampleRate in the codebase
rg "replaysOnErrorSampleRate" --type js --type ts --type jsx --type tsx

Length of output: 199


Script:

#!/bin/bash
# Corrected search for references to replaysSessionSampleRate in the codebase
rg "replaysSessionSampleRate" --type js --type ts --type tsx

# Corrected search for references to replaysOnErrorSampleRate in the codebase
rg "replaysOnErrorSampleRate" --type js --type ts --type tsx

Length of output: 177


Script:

#!/bin/bash
# Search for references to replaysSessionSampleRate in the codebase
rg "replaysSessionSampleRate" --type js --type ts

# Search for references to replaysOnErrorSampleRate in the codebase
rg "replaysOnErrorSampleRate" --type js --type ts

Length of output: 1404

.github/workflows/native-tests.yml (1)

18-18: Approve version updates, but verify compatibility.

The updates to the versions of styfle/cancel-workflow-action and reactivecircus/android-emulator-runner are approved. Ensure that these updates are compatible with the rest of the workflow and do not introduce any breaking changes.

Also applies to: 100-100, 120-120

src/js/integrations/default.ts (1)

119-128: Approve changes, but verify experimental options handling.

The changes to support replay integrations based on experimental options look good. Ensure that the handling of _experiments and the casting to BrowserOptions are correctly implemented and tested.

test/tools/metroconfig.test.ts (1)

1-95: Approve test enhancements.

The enhancements to the testing suite for Metro configuration, including the new tests and mocking of the fs module, are well-implemented and improve test coverage.

Tools
Biome

[error] 90-90: void is confusing inside a union type.

Unsafe fix: Use undefined instead.

(lint/suspicious/noConfusingVoidType)

src/js/replay/mobilereplay.ts (6)

1-8: Imports look good.

The imported modules and types are relevant to the functionality implemented in the file.


12-34: Interface definition is clear and well-documented.

The MobileReplayOptions interface is defined with clear documentation for each option.


36-44: Default options and type definition are correctly implemented.

The defaultOptions align with the MobileReplayOptions interface, and the MobileReplayIntegration type is well-defined.


64-102: Function implementation is correct and efficient.

The mobileReplayIntegration function correctly handles platform-specific logic and event processing.

Tools
Biome

[error] 81-81: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


104-122: Setup function is correctly implemented.

The event listeners for replay ID management and breadcrumb enrichment are well-implemented.


137-145: Noop function is correctly implemented.

The mobileReplayIntegrationNoop function provides a valid structure for a no-operation integration.

package.json (5)

5-5: Version update is appropriate.

The version update from 5.22.3 to 5.27.0 suggests significant improvements or new features.


70-78: Dependency updates are consistent.

The updates to Sentry-related dependencies are consistent across the board, ensuring compatibility.


70-70: New dependency addition is appropriate.

The addition of @sentry/babel-plugin-component-annotate likely introduces useful functionality for component annotation.


84-86: DevDependency updates are consistent.

The updates to Sentry-internal devDependencies are consistent, aligning with the main dependency updates.


110-110: React Native version update is appropriate.

The update to React Native version 0.73.9 likely includes important fixes or enhancements.

android/src/oldarch/java/io/sentry/react/RNSentryModule.java (2)

162-165: CaptureReplay method is correctly implemented.

The captureReplay method correctly delegates to the implementation and handles the promise.


167-170: GetCurrentReplayId method is correctly implemented.

The getCurrentReplayId method correctly retrieves the replay ID synchronously.

src/js/NativeRNSentry.ts (3)

47-48: New methods captureReplay and getCurrentReplayId added.

These methods enhance the functionality related to session replay. Ensure that these methods are properly implemented and tested in the codebase.

Verification successful

Methods captureReplay and getCurrentReplayId are implemented and used correctly.

The methods are implemented in src/js/wrapper.ts and used in src/js/replay/mobilereplay.ts. They include checks for native module availability, ensuring robustness. No further action is needed.

  • src/js/wrapper.ts: Implementation of both methods.
  • src/js/replay/mobilereplay.ts: Usage of both methods.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the implementation and usage of `captureReplay` and `getCurrentReplayId`.

# Test: Search for the function implementations and usage. Expect: Proper implementation and usage in the codebase.
rg --type typescript -A 5 $'captureReplay|getCurrentReplayId'

Length of output: 97


Script:

#!/bin/bash
# Searching for the implementation of `captureReplay` method
ast-grep --lang typescript --pattern 'captureReplay($_): $_ { $$$ }'

# Searching for the implementation of `getCurrentReplayId` method
ast-grep --lang typescript --pattern 'getCurrentReplayId(): $_ { $$$ }'

Length of output: 1051


Script:

#!/bin/bash
# Searching for the usage of `captureReplay` and `getCurrentReplayId` methods in the codebase
rg 'captureReplay|getCurrentReplayId' --type ts -A 5

Length of output: 3510


95-102: Modification in NativeAppStartResponse type structure.

The structure now includes a type field and an array of spans. This change improves the detail and clarity of the app start response. Ensure that all parts of the codebase that use this type are updated to handle the new structure.

Verification successful

Verification Successful: NativeAppStartResponse Type Changes Integrated Properly

The modifications to the NativeAppStartResponse type, including the addition of the type field and spans array, have been appropriately integrated across the codebase. The usage in test and source files confirms that these changes are being handled correctly.

  • Files Involved:
    • test/tracing/reactnativetracing.test.ts
    • src/js/wrapper.ts
    • src/js/NativeRNSentry.ts
    • src/js/tracing/reactnativetracing.ts

These files show proper handling of the new structure, ensuring the codebase is up-to-date with the changes.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `NativeAppStartResponse` type in the codebase.

# Test: Search for the type usage. Expect: Proper handling of the new structure in the codebase.
rg --type typescript -A 5 $'NativeAppStartResponse'

Length of output: 85


Script:

#!/bin/bash
# Description: Verify the usage of `NativeAppStartResponse` type in the codebase.

# Test: Search for the type usage. Expect: Proper handling of the new structure in the codebase.
rg 'NativeAppStartResponse' --glob '*.ts' -A 5

Length of output: 7241


16-16: Update in captureEnvelope method parameter.

The parameter store has been replaced with hardCrashed. Ensure that this change aligns with the intended functionality and that all usages of this method are updated accordingly in the codebase.

Verification successful

Update in captureEnvelope method verified.

The change from store to hardCrashed in the captureEnvelope method is consistently reflected across the codebase. The method calls in both TypeScript and native code (iOS and Android) correctly use the hardCrashed parameter. No further action is needed.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `captureEnvelope` match the new parameter.

# Test: Search for the function usage. Expect: Only occurrences with the new parameter.
rg --type typescript -A 5 $'captureEnvelope'

Length of output: 78


Script:

#!/bin/bash
# Description: Verify all function calls to `captureEnvelope` match the new parameter.

# Test: Search for the function usage. Expect: Only occurrences with the new parameter.
rg -A 5 'captureEnvelope'

Length of output: 9282

ios/RNSentryReplayBreadcrumbConverter.m (5)

11-17: Ensure proper initialization in init method.

The init method initializes the defaultConverter. Ensure that this initialization is necessary and correctly implemented.


19-64: Review convertFrom method for handling breadcrumb categories.

The method filters and converts breadcrumbs based on their category. Ensure that all relevant categories are handled and that the logic aligns with the intended functionality.


66-80: Review convertTouch method for touch event conversion.

This method converts touch breadcrumbs to a specific format. Ensure that the conversion logic is correct and that all necessary fields are included.


82-130: Review getTouchPathMessageFrom method for message construction.

This method constructs a message from a touch path. Ensure that the logic handles all edge cases and that the message format is correct.


132-164: Review convertNavigation method for navigation event conversion.

This method converts navigation breadcrumbs to a specific format. Ensure that the conversion logic is correct and that all necessary fields are included.

.github/workflows/sample-application.yml (2)

26-26: Update styfle/cancel-workflow-action version.

The version has been updated to 0.12.1. Ensure that the update includes necessary bug fixes or improvements and that it does not introduce any breaking changes.


111-111: Introduce NO_FLIPPER environment variable.

This variable is introduced to disable Flipper during iOS builds due to build issues. Ensure that this change resolves the build issues and does not affect other parts of the build process.

src/js/tools/metroconfig.ts (4)

15-21: Interface SentryMetroConfigOptions looks good.

The interface correctly defines an optional property for annotating React components.


23-28: Interface SentryExpoConfigOptions is well-defined.

The interface allows customization of the Expo configuration getter.


36-48: Function withSentryConfig is correctly updated.

The function now conditionally applies the Sentry Babel transformer based on the annotateReactComponents option.


Line range hint 56-76: Function getSentryExpoConfig is correctly expanded.

The function now supports additional configuration options and conditionally applies the Babel transformer.

scripts/expo-upload-sourcemaps.js (2)

152-162: Improved sentryUrl resolution logic.

The logic now assigns a default value to sentryUrl, enhancing robustness and providing clear logging messages.


214-217: Consistent formatting for asset upload warning message.

The formatting change improves consistency and readability.

src/js/integrations/debugsymbolicator.ts (3)

Line range hint 56-74: Enhanced processEvent function for multiple exceptions.

The function now handles multiple exceptions, improving robustness and clarity in error handling.


157-159: Refactored replaceExceptionFramesInException function.

The refactoring improves clarity and aligns with the new structure for handling exceptions.


214-221: New function getExceptionGroup is well-implemented.

The function enhances the capability to handle multiple exceptions by retrieving related exceptions.

samples/react-native/android/app/build.gradle (1)

137-138: Version updates approved.

The versionCode and versionName updates reflect a new release. Ensure that these changes are documented in your release notes.

RNSentryAndroidTester/app/src/test/java/io/sentry/rnsentryandroidtester/RNSentryReplayBreadcrumbConverterTest.kt (1)

1-170: Comprehensive test coverage approved.

The test cases cover a wide range of scenarios for breadcrumb conversion, ensuring robustness and reliability of the RNSentryReplayBreadcrumbConverter.

android/src/main/java/io/sentry/react/RNSentryReplayBreadcrumbConverter.java (1)

1-187: Implementation approved. Verify integration.

The RNSentryReplayBreadcrumbConverter is well-implemented, extending functionality to handle specific breadcrumb categories. Ensure that this integration is thoroughly tested within the application context.

Verification successful

Integration of RNSentryReplayBreadcrumbConverter is verified. The converter is integrated through RNSentryModuleImpl, which is used in both oldarch and newarch directories within RNSentryModule.java. This module is part of the React Native setup, confirming the converter's integration into the application.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the integration of RNSentryReplayBreadcrumbConverter in the application.

# Test: Search for the usage of `RNSentryReplayBreadcrumbConverter` in the codebase.
rg --type java 'RNSentryReplayBreadcrumbConverter'

Length of output: 664


Script:

#!/bin/bash
# Description: Verify the usage of `RNSentryModuleImpl` to ensure the integration of `RNSentryReplayBreadcrumbConverter`.

# Test: Search for the usage of `RNSentryModuleImpl` in the codebase.
rg --type java 'RNSentryModuleImpl'

Length of output: 1615


Script:

#!/bin/bash
# Description: Verify the usage of `RNSentryModule` to confirm the integration of `RNSentryReplayBreadcrumbConverter`.

# Test: Search for the usage of `RNSentryModule` in the codebase.
rg --type java 'RNSentryModule'

Length of output: 2201

src/js/client.ts (4)

117-120: LGTM! Initialization order improved.

The explicit call to super.init() before initializing the native SDK ensures proper initialization order.


Line range hint 125-133: LGTM! Access control and integration setup improved.

Changing _setupIntegrations to protected enhances encapsulation, and the conditional integration logic is well-implemented.


176-183: LGTM! Mobile replay options integration enhanced.

The conditional inclusion of mobile replay options based on integration presence is a well-structured enhancement.


65-65: Verify the temporary comment regarding thread usage.

The comment indicates that this logic is temporary and will be removed once the JS SDK uses threads for messages. Ensure this is tracked for future updates.

test/tracing/nativeframes.test.ts (2)

101-139: LGTM! Test case for zero start frames is well-implemented.

The test effectively verifies the correct reporting of native frames measurements when start frames are zero.


141-173: LGTM! Test case for excluding zero value measurements is well-implemented.

The test ensures that redundant native frames measurements are not reported when start and finish frames are identical.

RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryReplayBreadcrumbConverterTests.swift (4)

87-93: LGTM! Test case for non-conversion of sentry event breadcrumbs is correct.

The test effectively verifies that breadcrumbs with the "sentry.event" category are not converted.


95-101: LGTM! Test case for non-conversion of sentry transaction breadcrumbs is correct.

The test effectively verifies that breadcrumbs with the "sentry.transaction" category are not converted.


133-136: LGTM! Test case for nil return on empty array is correct.

The test effectively verifies that an empty array returns nil for touch path messages.

Tools
SwiftLint

[Warning] 135-135: Lines should not have trailing semicolons

(trailing_semicolon)


138-141: LGTM! Test case for nil return on nil array is correct.

The test effectively verifies that a nil array returns nil for touch path messages.

Tools
SwiftLint

[Warning] 140-140: Lines should not have trailing semicolons

(trailing_semicolon)

src/js/options.ts (3)

190-215: LGTM! Documentation is clear for new experimental options.

The addition of the _experiments property with detailed comments is well-executed, and the deprecation notice for useThreadsForMessageStack is clear.

Also applies to: 217-223


238-240: LGTM! Separation of experimental features is well-implemented.

The omission of _experiments from ReactNativeOptions helps maintain a clean and stable API.


243-244: LGTM! Consistent handling of experimental options.

The omission of _experiments from ReactNativeClientOptions aligns with the overall strategy to separate experimental features.

test/touchevents.test.tsx (3)

104-104: LGTM! Enhanced breadcrumb data structure is well-implemented.

The switch to a path array provides more detailed component information, improving the quality of logged data.

Also applies to: 163-163, 213-213


171-171: LGTM! Test case names and assertions are updated correctly.

The changes ensure that test cases accurately reflect the new data structure.


221-282: LGTM! New test cases enhance robustness.

The additional test cases for custom names and deduplication improve the reliability of the event logging mechanism.

Also applies to: 284-313

src/js/tracing/timetodisplay.tsx (3)

89-92: LGTM! Simplified type definition improves readability.

Changing from Exclude to Omit clarifies the type definition without affecting functionality.


230-230: LGTM! Enhanced logging provides better traceability.

The new debug log statement adds valuable context for debugging span updates.


Line range hint 240-278:
LGTM! Improved logging and refined timestamp handling.

The changes enhance logging specificity and ensure accurate span end timestamps, improving performance metrics.

samples/react-native/src/App.tsx (7)

53-65: Enhanced logging with logWithoutTracing.

The use of logWithoutTracing instead of console.log is a good practice for production environments to avoid cluttering the console. Ensure that this utility function is correctly implemented to handle logging appropriately.


229-244: Addition of PlaygroundTab to BottomTabs.

The new tab screen PlaygroundTab integrates PlaygroundScreen. Ensure that this screen is correctly implemented and provides the intended functionality.


251-257: Ensure platform compatibility for RunningIndicator.

The RunningIndicator component conditionally renders based on the platform. Verify that this logic correctly handles all intended platforms and scenarios.


259-282: Check the performance of RotatingBox.

The RotatingBox component uses useSharedValue and useAnimatedStyle to create animations. Ensure that these animations are performant and do not negatively impact the user experience.


288-298: Review the styles for RotatingBox.

The styles for RotatingBox define its position and appearance. Ensure that these styles are consistent with the overall design and do not cause layout issues.


9-15: Verify the necessity of all imports from react-native-reanimated.

Ensure that all imported functions from react-native-reanimated are being used in the code. Unused imports can be removed to improve readability and performance.

Verification successful

All imports from react-native-reanimated are used.

The imported functions useAnimatedStyle, useSharedValue, withRepeat, withTiming, and Easing from react-native-reanimated are all utilized in the code. No unnecessary imports are present.

  • useSharedValue is used to create a shared value.
  • withRepeat and withTiming are used to create an animation.
  • Easing is used to define the easing function for the animation.
  • useAnimatedStyle is used to create an animated style.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of imported functions from `react-native-reanimated`.

# Test: Search for the usage of each imported function. Expect: Each function should be used at least once.
rg --type typescript -A 5 $'(useAnimatedStyle|useSharedValue|withRepeat|withTiming|Easing)'

Length of output: 127


Script:

#!/bin/bash
# Description: Verify the usage of imported functions from `react-native-reanimated`.

# Test: Search for the usage of each imported function. Expect: Each function should be used at least once.
rg --type ts -A 5 $'(useAnimatedStyle|useSharedValue|withRepeat|withTiming|Easing)'

Length of output: 1645


95-99: Consider the impact of enabling mobileReplayIntegration.

The mobileReplayIntegration is enabled with image and vector masking. Ensure that this feature is necessary and that the masking settings align with privacy requirements.

src/js/tracing/nativeframes.ts (5)

14-14: Good practice: Use of FINAL_FRAMES_TIMEOUT_MS for timeout consistency.

Replacing hardcoded timeout values with a constant improves maintainability and readability. Ensure that this constant is used consistently throughout the codebase.


55-72: Enhanced logging in onTransactionStart.

The additional logging provides better traceability for frame-fetching processes. Ensure that the log messages are informative and do not expose sensitive information.


86-90: Improved error context in onTransactionFinish.

Including the transaction span ID in error logs enhances the context of error messages. Ensure that this information is used effectively for debugging.


Line range hint 212-229:
Refactored _fetchEndFramesForTransaction.

The method now uses FINAL_FRAMES_TIMEOUT_MS and includes improved logic for fetching frames. Ensure that the refactoring maintains the intended functionality.


Line range hint 235-242:
Refactored _cancelEndFrames.

Renaming this method aligns with its purpose and enhances clarity. Ensure that all references to the old method name have been updated.

src/js/touchevents.tsx (4)

56-58: New constants for Sentry properties.

The introduction of constants for Sentry-related properties enhances code readability and maintainability. Ensure that these constants are used consistently throughout the codebase.


69-74: Introduction of TouchedComponentInfo interface.

The new interface provides a structured way to handle touched component information. Ensure that this interface is used effectively in the touch event logging process.


125-137: Refactored _logTouchEvent method.

The method now accepts TouchedComponentInfo[], allowing for more detailed logging. Ensure that this change does not introduce any regressions in functionality.


237-260: New helper functions for extracting component information.

The functions getTouchedComponentInfo, getComponentName, getElementName, and getFileName provide a structured way to extract component information. Ensure that these functions are efficient and correctly implemented.

test/tracing/timetodisplay.test.tsx (1)

244-278: New test case is well-structured and comprehensive.

The added test case effectively validates the behavior of the display timing logic under specific conditions. It follows the existing patterns and uses appropriate assertions.

test/wrapper.test.ts (1)

279-279: Parameter updates enhance error handling.

The replacement of store with hardCrashed and the update of mechanism.type to 'onerror' improve the robustness and clarity of crash reporting.

Also applies to: 311-311, 348-348, 387-387, 416-416, 429-429, 451-455

sentry.gradle (1)

186-186: Enhanced flexibility in authentication token handling.

The fallback mechanism for the --auth-token argument improves the robustness of the authentication process by using an environment variable as an alternative.

test/tracing/reactnavigation.ttid.test.tsx (1)

39-42: LGTM! Verify the usage of updated mock structure.

The changes to the mock function improve clarity and consistency.

Ensure that the updated structure is correctly used in other parts of the test suite.

Verification successful

Verify the usage of updated mock structure

The fetchNativeAppStart function is used across multiple files in the test suite. The updated mock structure appears to be consistently applied in various test files, such as test/client.test.ts, test/tracing/reactnativetracing.test.ts, and test/mockWrapper.ts. This suggests that the changes to the mock function for clarity and consistency have been propagated throughout the relevant parts of the codebase.

  • Files with updated mock usage:
    • test/client.test.ts
    • test/tracing/reactnativetracing.test.ts
    • test/mockWrapper.ts

The usage of fetchNativeAppStart in these files indicates that the updated mock structure is being used consistently.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify usage of updated mock structure in the test suite.

# Test: Search for the usage of `fetchNativeAppStart`. Expect: Consistent usage of the new structure.
rg --type tsx 'fetchNativeAppStart'

Length of output: 63


Script:

#!/bin/bash
# Description: Verify usage of updated mock structure in TypeScript files.

# Test: Search for the usage of `fetchNativeAppStart` in TypeScript files.
rg 'fetchNativeAppStart' --glob '*.ts' --glob '*.tsx'

Length of output: 2036

src/js/wrapper.ts (2)

51-53: LGTM! The new NativeSdkOptions type enhances flexibility.

The introduction of NativeSdkOptions allows for a more structured configuration, which is a positive change.


113-114: LGTM! Verify integration of new methods.

The addition of captureReplay and getCurrentReplayId methods enhances replay handling.

Ensure these methods are properly integrated and used throughout the codebase.

Also applies to: 632-633

Verification successful

Methods Properly Integrated

The methods captureReplay and getCurrentReplayId are properly integrated and used in the codebase, particularly in the replay handling logic.

  • Defined in: src/js/wrapper.ts
  • Used in: src/js/replay/mobilereplay.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify integration and usage of new methods `captureReplay` and `getCurrentReplayId`.

# Test: Search for the usage of `captureReplay` and `getCurrentReplayId`. Expect: Proper integration and usage.
rg --type ts 'captureReplay|getCurrentReplayId'

Length of output: 1444

test/client.test.ts (2)

691-705: LGTM! New tests for user interaction tracing are well-structured.

The new tests effectively validate the registration of user interaction tracing.

Also applies to: 723-737


244-244: LGTM! Ensure consistent use of .init() method.

The addition of the .init() method call ensures proper initialization of the client.

Verify that .init() is used consistently across tests where needed.

Also applies to: 257-257, 272-272, 293-293

Verification successful

To ensure that the .init() method is used consistently in test/client.test.ts, let's check if all instances of client initialization in this file are followed by .init(). This will help confirm the consistency as per the review comment.


Let's adjust our approach to find any instantiation of the Client class and ensure .init() is called on those instances.


Let's search for any references to the Client class within test/client.test.ts to understand its usage and ensure .init() is consistently applied.


The ReactNativeClient class is instantiated multiple times in test/client.test.ts, and there are several .init() calls in the file as well. This suggests that the .init() method is used consistently across relevant tests, aligning with the review comment's suggestion.

Consistent Use of .init() Method Verified

The .init() method is used consistently across tests in test/client.test.ts where the ReactNativeClient is instantiated.

  • Instances of ReactNativeClient are followed by .init() calls, ensuring proper initialization.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify consistent use of `.init()` method across tests.

# Test: Search for the usage of `.init()` method. Expect: Consistent usage across relevant tests.
rg --type ts 'init\(\)'

Length of output: 1052


Script:

#!/bin/bash
# Check for instances of client initialization in `test/client.test.ts` to ensure `.init()` is consistently used.
rg --type ts 'client\s*=\s*new\s+Client' -A 3 test/client.test.ts

Length of output: 67


Script:

#!/bin/bash
# Search for any instantiation of the `Client` class in `test/client.test.ts` and check for `.init()` calls.
rg --type ts 'new\s+Client' -A 5 test/client.test.ts

Length of output: 54


Script:

#!/bin/bash
# Search for any reference to `Client` in `test/client.test.ts` to understand its usage.
rg --type ts 'Client' test/client.test.ts

Length of output: 2223

RNSentryCocoaTester/RNSentryCocoaTester.xcodeproj/project.pbxproj (4)

10-11: New test files added to the build process.

The addition of RNSentryBreadcrumbTests.m and RNSentryReplayBreadcrumbConverterTests.swift to the build process is appropriate for expanding test coverage.


21-25: New file references added.

The addition of file references for RNSentryBreadcrumb.h, RNSentryReplayBreadcrumbConverter.h, RNSentryBreadcrumbTests.swift, and the bridging header is correctly configured for project integration.


144-149: Project attributes updated for Swift compatibility.

The addition of LastSwiftUpdateCheck and LastSwiftMigration attributes reflects the project's alignment with the latest Swift developments.


Line range hint 346-468:
Build configuration enhancements approved.

The updates to include CLANG_ENABLE_MODULES = YES and set SWIFT_VERSION = 5.0 are beneficial for module support and Swift compatibility.

.github/workflows/e2e.yml (4)

25-25: Dependency version update approved.

The update of styfle/cancel-workflow-action to version 0.12.1 ensures the latest features and fixes are utilized.


171-179: React Native version update approved.

Updating the RN version to 0.73.9 aligns the workflow with the latest RN version for testing and compatibility.


234-237: Conditional steps for Yarn v3 approved.

The new steps for enabling Corepack and using Yarn v3 for RN 0.73.9 ensure compatibility and proper dependency management.


588-588: Dependency version update approved.

The update of reactivecircus/android-emulator-runner to version v2.31.0 ensures the latest features and fixes are utilized.

samples/react-native/src/components/SvgGraphic.tsx (2)

1-2: LGTM!

The import statements are appropriate for the functionality provided by the component.


288-288: LGTM!

The export statement follows standard practices for React components.

ios/RNSentry.mm (6)

26-26: Imports for replay functionality look good.

The addition of RNSentryBreadcrumb and conditional import of RNSentryReplay are appropriate for the new replay features.

Also applies to: 41-43


62-62: Variable rename enhances clarity.

Renaming didFetchAppStart to hasFetchedAppStart improves clarity by better describing its purpose as a boolean flag.


643-650: Ensure conditional compilation for replay ID retrieval.

The getCurrentReplayId method is also conditionally compiled based on SENTRY_TARGET_REPLAY_SUPPORTED. Verify that the flag is correctly managed.


146-148: Integration of replay options update is correct.

The call to RNSentryReplay.updateOptions within createOptionsWithDictionary is correctly placed to integrate replay functionality.


562-564: Simplified breadcrumb creation is effective.

Using RNSentryBreadcrumb.from for breadcrumb creation encapsulates the logic and simplifies the method.


631-641: Ensure conditional compilation for replay support.

The captureReplay method is conditionally compiled based on SENTRY_TARGET_REPLAY_SUPPORTED. Ensure that this flag is correctly set in the build configuration to include or exclude replay functionality as needed.

src/js/tracing/reactnativetracing.ts (6)

137-138: New property for app start filtering is appropriate.

The addition of _maxAppStartBeforeTransactionMs provides a useful constraint for filtering app start data, enhancing performance measurement precision.


159-159: Tracking root component constructor call timestamp is beneficial.

The _firstConstructorCallTimestampMs property is essential for precise app lifecycle tracking, particularly for measuring JavaScript execution time.


425-429: Streamlined input for app start duration calculation is effective.

Accepting a timestamp in milliseconds in _getAppStartDurationMilliseconds improves clarity and aligns with the app start tracking enhancements.


311-313: Method for setting root component constructor timestamp is well-placed.

The setRootComponentFirstConstructorCallTimestampMs method is crucial for lifecycle tracking and is appropriately integrated.


537-560: Enhancements to JS execution timing are beneficial.

The _addJSExecutionBeforeRoot method improves the granularity of performance measurements by tracking JavaScript execution before the root component.


565-578: Incorporating native spans enhances tracing capabilities.

The _addNativeSpansTo method effectively incorporates native spans into the app start span, enhancing tracing capabilities.

test/integrations/debugsymbolicator.test.ts (5)

57-65: Mock functions for stack traces enhance test coverage.

The customMockRawStack function effectively simulates error stack traces, facilitating comprehensive testing.


66-86: Mock functions for parsed frames enhance test coverage.

The customMockSentryParsedFrames function effectively simulates parsed stack frames, enhancing the robustness of the tests.


368-517: Test case for error with cause is comprehensive.

The test case for symbolicating an error with a cause ensures robustness in handling complex error structures.


519-708: Test case for error with multiple causes is comprehensive.

The test case for symbolicating an error with multiple causes ensures robustness in handling nested error structures.


710-846: Test case for uneven exception hints is robust.

The test case for symbolicating errors with different amounts of exception hints ensures robustness in handling uneven scenarios.

samples/react-native/ios/sentryreactnativesample.xcodeproj/project.pbxproj (6)

51-51: Ensure PrivacyInfo.xcprivacy is correctly referenced.

The reference to PrivacyInfo.xcprivacy in the PBXFileReference section is correct. Ensure that this file is included in the project directory.


107-107: Include PrivacyInfo.xcprivacy in the project group.

Adding PrivacyInfo.xcprivacy to the PBXGroup ensures it is part of the project structure. Verify its presence in the specified path.


260-260: Add PrivacyInfo.xcprivacy to the build phase resources.

Including PrivacyInfo.xcprivacy in the PBXResourcesBuildPhase ensures it is packaged with the app. Confirm that it is correctly processed during the build.


633-636: Reformat OTHER_CFLAGS for clarity.

The change from a single string to an array format for OTHER_CFLAGS improves readability and maintainability. Ensure that all flags are correctly specified.


643-643: Reformat OTHER_LDFLAGS for simplicity.

The change from an array to a single string format for OTHER_LDFLAGS simplifies the configuration. Verify that the flags are correctly inherited.


17-17: Add PrivacyInfo.xcprivacy to the project resources.

The addition of PrivacyInfo.xcprivacy ensures compliance with privacy regulations. Verify that this file contains the necessary privacy information for your app.

android/src/main/java/io/sentry/react/RNSentryModuleImpl.java (10)

44-48: Add necessary imports for session replay.

The addition of HashSet and Set imports supports the new session replay functionality. Ensure these imports are utilized effectively.


66-66: Add import for SentryReplayOptions.

The import of SentryReplayOptions is necessary for handling session replay configurations. Ensure this class is used correctly in the implementation.


110-110: Rename didFetchAppStart to hasFetchedAppStart.

Renaming the variable improves readability and better reflects its purpose. Ensure that all references to this variable are updated.


206-208: Add sampleRate option to initNativeSdk.

The inclusion of sampleRate in initNativeSdk enhances configuration flexibility. Verify that the sample rate is correctly applied in all relevant scenarios.


262-265: Integrate session replay options in initNativeSdk.

The integration of session replay options via getReplayOptions and RNSentryReplayBreadcrumbConverter enhances functionality. Ensure these options are correctly configured and tested.


306-340: Implement getReplayOptions method.

The getReplayOptions method constructs SentryReplayOptions based on input, providing granular control over session replay. Ensure all keys are correctly handled and tested.


383-393: Refactor fetchNativeAppStart method.

The refactoring of fetchNativeAppStart simplifies logic and improves clarity. Ensure the measurement map is correctly populated and returned.


443-446: Add captureReplay method.

The captureReplay method enhances replay capture capabilities. Verify that it interacts correctly with the Sentry hub and handles promises appropriately.


448-459: Add getCurrentReplayId method.

The getCurrentReplayId method retrieves the current replay ID, improving replay management. Ensure it handles null cases and returns the correct ID.


618-622: Improve breadcrumb handling.

The use of RNSentryBreadcrumb.fromMap and screen extraction enhances breadcrumb management. Verify that breadcrumbs are correctly added and screens are accurately set.

test/tracing/reactnativetracing.test.ts (1)

1214-1241: Enhancements to mockAppStartResponse look good!

The additional parameters has_fetched, enableNativeSpans, and customNativeSpans provide more flexibility in simulating app start scenarios. This improves the robustness of the tests.

CHANGELOG.md (1)

5-148: Comprehensive documentation of changes.

The changelog entries are detailed and well-structured, providing clear information about fixes, features, and dependency updates. Links to pull requests and changelogs enhance traceability.

logger.debug('Saved default Babel transformer path');
} catch (e) {
// eslint-disable-next-line no-console
console.error('[Sentry] Failed to save default Babel transformer path:', e);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using a consistent logging approach.

While console statements are used for error logging, consider using the logger for consistency across the codebase. This approach allows for better control over log levels and formatting.

Also applies to: 30-30, 45-45


function addSentryComponentAnnotatePlugin(args: BabelTransformerArgs | undefined): void {
if (!args || typeof args.filename !== 'string' || !Array.isArray(args.plugins)) {
return undefined;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove redundant return statement.

The function addSentryComponentAnnotatePlugin should not return a value since its return type is void. The return statement is unnecessary.

-    return undefined;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
return undefined;
Tools
Biome

[error] 32-32: The function should not return a value because its return type is void.

The function is here:

'void' signals the absence of value. The returned value is likely to be ignored by the caller.

(lint/correctness/noVoidTypeReturn)

Comment on lines +4 to +287
<Path
d="M51.563 161.724 40.27 177.258l1.457 2.349-.887.262-1.514-1.214-1.936 1.478-1.66-1.003.976-1.527-1.817.22-.191-.82 3.921-.864 13.427-15.924-.482 1.509zM69.76 190.448c.295-.82-2.389-2.234-2.389-2.234s3.95-6.424 4.368-7.042c.412-.621.235-1.133-.09-1.48-.168-.173-7.384-8.018-7.384-8.018l-.4.805 6.162 8.095-6.396 8.758s1.15.875 2.325 1.299c1.242.448 3.64.25 3.803-.183ZM59.462 195.904c.353-.978-2.85-2.666-2.85-2.666s4.713-7.666 5.212-8.404c.493-.74.281-1.352-.108-1.767-.2-.205-2.06-2.266-3.866-4.263-1.772-1.973-3.498-3.877-3.498-3.877l-.478.96 3.138 4.373 2.77 3.862-6.283 9.91s.022 1.585 1.424 2.09c1.483.536 4.345.299 4.54-.217Z"
fill="#ece8f0"
/>
<Path
d="M68.215 191.335c-.766 0-1.575-.128-2.098-.316-1.195-.431-2.66-1.214-2.722-1.247a.502.502 0 0 1-.167-.735l6.174-8.456-5.934-7.8a.5.5 0 0 1-.051-.524l.4-.805a.5.5 0 0 1 .816-.117c2.481 2.698 7.215 7.843 7.374 8.007.57.609.622 1.394.147 2.107-.344.51-3.18 5.112-4.082 6.58 1.117.643 2.493 1.655 2.157 2.589l-.002.006c-.194.517-1.07.712-2.012.712Zm1.544-.887h.01-.01Zm-5.38-1.293c.526.263 1.367.667 2.078.923.974.352 2.325.28 2.784.137-.206-.353-1.13-1.047-2.103-1.56a.502.502 0 0 1-.193-.703c.162-.263 3.96-6.44 4.38-7.06.218-.329.206-.595-.042-.86-.12-.123-3.851-4.177-5.988-6.5l5.129 6.74a.498.498 0 0 1 .006.598l-6.051 8.285ZM57.918 196.803c-.912 0-1.93-.176-2.605-.42-1.457-.526-3.016-1.7-3.081-1.75a.5.5 0 0 1-.105-.69l7.04-9.821-5.7-7.942a.503.503 0 0 1-.041-.514l.477-.962a.502.502 0 0 1 .819-.114s1.727 1.907 3.5 3.88l.508.56c1.558 1.725 3.17 3.51 3.345 3.69.656.697.713 1.567.166 2.39-.42.622-3.913 6.294-4.927 7.943 1.187.678 3.013 1.927 2.619 3.022l-.003.007c-.198.523-1.046.721-2.012.721Zm1.544-.898h.01-.01Zm-6.23-1.786c.533.367 1.518.998 2.42 1.323 1.218.442 2.873.423 3.327.236-.128-.397-1.327-1.326-2.6-1.997a.502.502 0 0 1-.192-.704c.192-.313 4.724-7.684 5.223-8.423.286-.431.269-.796-.057-1.144-.182-.187-1.658-1.82-3.366-3.71l-.507-.562c-1.195-1.329-2.369-2.627-3.006-3.333l-.018.036 5.731 7.99a.499.499 0 0 1 0 .582l-6.956 9.706Z"
fill="#2f1d4a"
/>
<Path
d="m57.7 145.842 11.835 21.873c.181.334-.038.9-.4 1.038l-22.158 8.39c-.553.21-.996-.228-.802-.799l10.324-30.351c.213-.624.9-.707 1.2-.15Z"
fill="#fff"
/>
<Path
d="m58.802 146.73 11.836 21.872c.181.334-.038.9-.4 1.038l-22.158 8.39c-.553.21-.996-.228-.802-.799l10.324-30.35c.213-.625.9-.708 1.2-.152Z"
fill="#ebb432"
/>
<Path
d="M46.32 178.124a.94.94 0 0 1-.66-.26c-.268-.26-.352-.661-.22-1.049l10.609-31.256c.141-.42.478-.7.879-.736.385-.038.755.175.957.545l12.374 22.566c.135.244.148.557.037.856a1.065 1.065 0 0 1-.606.645l-22.981 8.616c-.13.05-.262.073-.39.073Zm10.688-32.361c-.006.001-.04.023-.067.099l-10.609 31.257 23.026-8.567c.034-.021.079-.131.069-.178L57.059 145.82c-.025-.044-.046-.057-.051-.058Z"
fill="#2f1d4a"
/>
<Path
d="m59.054 163.852-.61-9.105-1.94.436 1.38 8.965 1.17-.296z"
fill="#2f1d4a"
/>
<Ellipse
cx={59.172}
cy={167.608}
fill="#2f1d4a"
rx={1.022}
ry={1.387}
transform="rotate(-3.371 59.174 167.61)"
/>
<Path
d="M36.991 180.333a.53.53 0 0 1-.275-.077l-1.661-1.003a.531.531 0 0 1-.173-.742l.37-.577-.7.085a.53.53 0 0 1-.581-.408l-.19-.82a.533.533 0 0 1 .404-.64l3.745-.824 13.31-15.786a.53.53 0 0 1 .913.505l-.481 1.508a.547.547 0 0 1-.076.15L40.51 176.95l1.27 2.045a.535.535 0 0 1-.301.79l-.888.263a.535.535 0 0 1-.485-.095L38.92 179l-1.605 1.224a.535.535 0 0 1-.323.11Zm-.919-1.708.884.534 1.649-1.258a.532.532 0 0 1 .655.008l1.184.949-1.026-1.652a.531.531 0 0 1 .022-.592l7.544-10.375-8.358 9.91a.53.53 0 0 1-.292.178l-1.92.422a.535.535 0 0 1 .342.81l-.684 1.066Zm15.093-17.233h.01-.01Z"
fill="#2f1d4a"
/>
<Path
d="m219.126 173.572 7.678 37.023 10.758-2.263a.92.92 0 0 0 .682-1.008l-4.486-36.339a.917.917 0 0 0-1.12-.786l-13.512 3.373Z"
fill="#fff"
/>
<Ellipse cx={171.171} cy={187.529} fill="#b19cd1" rx={2.689} ry={5.892} />
<Ellipse cx={174.374} cy={211.567} fill="#b19cd1" rx={2.689} ry={5.892} />
<Path
d="m219.739 174.09-40.07-14.248-.475 1.884 5.611 2.48-1.536 5.665 5.066-.227 1.228-2.404 27.31 8.257"
fill="#ece8f0"
/>
<Path
d="M216.767 175.755a.504.504 0 0 1-.14-.02L189.86 167.9l-1.04 2.035a.499.499 0 0 1-.422.272l-5.066.227c-.157.023-.312-.061-.413-.186a.5.5 0 0 1-.092-.444l1.424-5.25-5.219-2.307a.5.5 0 0 1-.282-.58l.475-1.883a.499.499 0 0 1 .654-.348l40.223 14.577a.499.499 0 1 1-.34.94l-39.703-14.39-.236.94 5.225 2.31a.5.5 0 0 1 .28.588l-1.356 5.004 4.09-.184 1.097-2.144a.5.5 0 0 1 .585-.252l27.163 7.95a.499.499 0 0 1-.141.98Z"
fill="#2f1d4a"
/>
<Path
d="M187.509 168.498h-.015l-1.607-.048a.5.5 0 0 1-.472-.617l.61-2.518a.501.501 0 0 1 .351-.364l2.463-.689a.5.5 0 0 1 .27.963l-2.181.61-.396 1.633.678.02.477-.913a.503.503 0 0 1 .603-.243l1.475.498a.5.5 0 1 1-.32.948l-1.07-.362-.423.813a.5.5 0 0 1-.443.269Z"
fill="#2f1d4a"
/>
<Path
d="m205.687 188.802-31.12-1.492s-1.392-3.51-3.166-4.187c-.513-.195-1.158.439-1.158.439l.936 8.214 35.157-1.568M206.654 198.135l-33.213 9.45.3 8.646.855.122s2.824-.89 2.692-5.72c4.575-2.006 29.817-10.883 29.817-10.883M223.417 210.942l27.706 14.18 2.004 2.685.954-.487-1.365-2.94 4.892 1.837.327-1.078-4.36-2.413 4.493-.72-.212-1.172-5.854.015 1.354-3.42-1.091-.605-2.714 3.972-24.725-11.08-1.41 1.226z"
fill="#ece8f0"
/>
<Path
d="M253.127 228.307a.497.497 0 0 1-.4-.201l-1.935-2.59-27.602-14.128a.5.5 0 1 1 .455-.89l27.706 14.18a.501.501 0 0 1 .173.146l1.752 2.346.15-.077-1.163-2.503a.498.498 0 0 1 .629-.678l4.393 1.65.055-.182-4.006-2.216a.5.5 0 0 1 .163-.932l3.989-.639-.047-.257-5.436.013a.5.5 0 0 1-.466-.683l1.192-3.013-.308-.17-2.457 3.595c-.137.2-.4.274-.617.174l-24.725-11.08c-.252-.112-.365-.408-.252-.66.113-.252.41-.365.66-.252l24.344 10.908 2.478-3.627a.502.502 0 0 1 .655-.155l1.091.605a.5.5 0 0 1 .223.62l-1.082 2.736 5.117-.013a.5.5 0 0 1 .493.412l.212 1.171a.504.504 0 0 1-.413.583l-3.062.49 3.092 1.712a.5.5 0 0 1 .237.583l-.329 1.078a.499.499 0 0 1-.654.322l-3.748-1.408.85 1.832a.5.5 0 0 1-.225.656l-.954.487a.498.498 0 0 1-.227.055Z"
fill="#2f1d4a"
/>
<Path
d="m232.831 171.103 4.139 36.171-28.395 6.976-2.77-36.032 27.026-7.115z"
fill="#fff"
/>
<Path
d="M208.574 214.75a.497.497 0 0 1-.498-.462l-2.768-36.032a.5.5 0 0 1 .37-.521l27.026-7.115a.5.5 0 0 1 .624.427l4.139 36.17a.5.5 0 0 1-.378.542l-28.396 6.976a.49.49 0 0 1-.119.015Zm-2.238-36.155 2.691 35.029 27.396-6.731-4.023-35.16-26.064 6.862Z"
fill="#2f1d4a"
/>
<Path
d="M217.7 179.193a.398.398 0 0 1 .108-.104l6.123-2.904a.488.488 0 0 1 .665.232.498.498 0 0 1-.231.665l-6.103 2.925a.498.498 0 0 1-.665-.231.508.508 0 0 1 .103-.583ZM218.043 182.345a.488.488 0 0 1 .263-.129l6.618-1.154a.498.498 0 0 1 .575.406l.002.007a.488.488 0 0 1-.406.57l-6.625 1.147a.498.498 0 0 1-.427-.847ZM215.236 183.872c-.369 0-.75-.149-1.104-.44-.582-.478-1.065-1.345-.86-2.076.126-.453.5-.758 1.027-.834.981-.145 1.96.708 2.228 1.56.22.692-.043 1.323-.682 1.644a1.34 1.34 0 0 1-.609.145Zm-.725-2.365a.39.39 0 0 0-.069.005c-.183.027-.2.087-.208.112-.062.225.157.727.533 1.037.138.113.405.285.629.172.17-.085.26-.19.177-.452-.14-.444-.675-.874-1.062-.874ZM226.287 172.544l4.01 36.16 6.506-1.552-4.035-35.927-6.48 1.319zM171.179 192.276a.5.5 0 0 1-.497-.444l-.936-8.213a.5.5 0 0 1 .147-.413c.09-.088.897-.855 1.686-.55 1.666.635 2.923 3.236 3.328 4.169l30.805 1.477a.499.499 0 0 1 .475.524c-.013.275-.21.512-.524.474l-31.12-1.492a.498.498 0 0 1-.44-.315c-.366-.92-1.596-3.414-2.88-3.904-.075-.032-.272.056-.452.184l.852 7.482 34.69-1.546h.023a.499.499 0 0 1 .023.998l-35.158 1.568a.176.176 0 0 1-.022 0ZM174.596 216.853a.589.589 0 0 1-.072-.005l-.855-.123a.502.502 0 0 1-.429-.477l-.299-8.645a.499.499 0 0 1 .364-.498l33.212-9.451c.266-.08.54.078.617.344s-.078.542-.344.617l-32.835 9.345.27 7.835.312.045c.452-.2 2.359-1.276 2.251-5.192a.503.503 0 0 1 .299-.471c4.54-1.992 28.82-10.537 29.852-10.899a.5.5 0 1 1 .332.943c-.248.087-24.258 8.537-29.478 10.74-.001 4.851-2.92 5.829-3.047 5.869a.494.494 0 0 1-.15.023Z"
fill="#2f1d4a"
/>
<Ellipse
cx={230.41}
cy={174.317}
rx={1.504}
ry={1.258}
fill="#e0557a"
transform="rotate(-7.162 230.411 174.317)"
/>
<Ellipse
cx={230.909}
cy={178.292}
rx={1.504}
ry={1.258}
fill="#eab332"
transform="rotate(-7.162 230.91 178.293)"
/>
<Ellipse
cx={231.409}
cy={182.267}
rx={1.504}
ry={1.258}
fill="#f48352"
transform="rotate(-7.162 231.41 182.268)"
/>
</Svg>
);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding prop types or default props.

To enhance maintainability and usage clarity, consider defining prop types or default props for the component.

import PropTypes from 'prop-types';

SvgComponent.propTypes = {
  width: PropTypes.number,
  height: PropTypes.number,
  // Add other props as needed
};

SvgComponent.defaultProps = {
  width: 259.492,
  height: 336.983,
  // Add other default values as needed
};

XCTAssertEqual(actualCrumb!.category, "testCategory")
XCTAssertEqual(actualCrumb!.type, "testType")
XCTAssertEqual(actualCrumb!.message, "testMessage")
XCTAssertEqual((actualCrumb!.data)!["test"] as! String, "data")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid force casting. Use optional binding instead.

Force casting with as! can lead to runtime crashes if the cast fails. Use optional binding to safely unwrap the value.

if let testData = (actualCrumb!.data)?["test"] as? String {
    XCTAssertEqual(testData, "data")
} else {
    XCTFail("Expected 'data' in breadcrumb data")
}
Tools
SwiftLint

[Error] 21-21: Force casts should be avoided

(force_cast)

Comment on lines +23 to +24
const sentryOptions = '{ annotateReactComponents: true }';

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Define sentryOptions as an object.

Consider defining sentryOptions as a JavaScript object instead of a string for better readability and maintainability.

- const sentryOptions = '{ annotateReactComponents: true }';
+ const sentryOptions = { annotateReactComponents: true };
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const sentryOptions = '{ annotateReactComponents: true }';
const sentryOptions = { annotateReactComponents: true };

Comment on lines 45 to 52
let data = event["data"] as! [String: Any?]
let payload = data["payload"] as! [String: Any?]
let payloadData = payload["data"] as! [String: Any?]
assertRRWebBreadcrumbDefaults(actual: event)
XCTAssertEqual("info", payload["level"] as! String)
XCTAssertEqual("navigation", payload["category"] as! String)
XCTAssertNil(payloadData["from"] ?? nil)
XCTAssertEqual("ProfileScreen", payloadData["to"] as! String)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid force casts for safety.

Force casts can lead to runtime crashes. Consider using optional binding (if let) or conditional casting (as?) to safely unwrap values.

if let data = event["data"] as? [String: Any],
   let payload = data["payload"] as? [String: Any],
   let payloadData = payload["data"] as? [String: Any] {
    // Use payloadData safely
}
Tools
SwiftLint

[Error] 45-45: Force casts should be avoided

(force_cast)


[Error] 46-46: Force casts should be avoided

(force_cast)


[Error] 47-47: Force casts should be avoided

(force_cast)


[Error] 49-49: Force casts should be avoided

(force_cast)


[Error] 50-50: Force casts should be avoided

(force_cast)


[Error] 52-52: Force casts should be avoided

(force_cast)

Comment on lines 65 to 68
let data = event["data"] as! [String: Any?]
let payload = data["payload"] as! [String: Any?];
assertRRWebBreadcrumbDefaults(actual: event)
XCTAssertEqual(payload["category"] as! String, "app.foreground")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid force casts and trailing semicolons for safety and style.

Force casts can lead to runtime crashes. Consider using optional binding (if let) or conditional casting (as?) to safely unwrap values. Remove the trailing semicolon for better style.

if let data = event["data"] as? [String: Any],
   let payload = data["payload"] as? [String: Any] {
    XCTAssertEqual(payload["category"] as? String, "app.foreground")
}
Tools
SwiftLint

[Error] 65-65: Force casts should be avoided

(force_cast)


[Error] 66-66: Force casts should be avoided

(force_cast)


[Error] 68-68: Force casts should be avoided

(force_cast)


[Warning] 66-66: Lines should not have trailing semicolons

(trailing_semicolon)

Comment on lines 81 to 84
let data = event["data"] as! [String: Any?]
let payload = data["payload"] as! [String: Any?];
assertRRWebBreadcrumbDefaults(actual: event)
XCTAssertEqual(payload["category"] as! String, "app.background")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid force casts and trailing semicolons for safety and style.

Force casts can lead to runtime crashes. Consider using optional binding (if let) or conditional casting (as?) to safely unwrap values. Remove the trailing semicolon for better style.

if let data = event["data"] as? [String: Any],
   let payload = data["payload"] as? [String: Any] {
    XCTAssertEqual(payload["category"] as? String, "app.background")
}
Tools
SwiftLint

[Error] 81-81: Force casts should be avoided

(force_cast)


[Error] 82-82: Force casts should be avoided

(force_cast)


[Error] 84-84: Force casts should be avoided

(force_cast)


[Warning] 82-82: Lines should not have trailing semicolons

(trailing_semicolon)

Comment on lines 120 to 130
let data = event["data"] as! [String: Any?]
let payload = data["payload"] as! [String: Any?]
let payloadData = payload["data"] as! [String: Any?]
assertRRWebBreadcrumbDefaults(actual: event)
XCTAssertEqual("info", payload["level"] as! String)
XCTAssertEqual("ui.tap", payload["category"] as! String)
XCTAssertEqual(1, payloadData.keys.count)
XCTAssertEqual([[
"element": "element4",
"file": "file4"
]], payloadData["path"] as! [[String: String]])
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid force casts for safety.

Force casts can lead to runtime crashes. Consider using optional binding (if let) or conditional casting (as?) to safely unwrap values.

if let data = event["data"] as? [String: Any],
   let payload = data["payload"] as? [String: Any],
   let payloadData = payload["data"] as? [String: Any] {
    // Use payloadData safely
}
Tools
SwiftLint

[Error] 120-120: Force casts should be avoided

(force_cast)


[Error] 121-121: Force casts should be avoided

(force_cast)


[Error] 122-122: Force casts should be avoided

(force_cast)


[Error] 124-124: Force casts should be avoided

(force_cast)


[Error] 125-125: Force casts should be avoided

(force_cast)


[Error] 130-130: Force casts should be avoided

(force_cast)

Comment on lines 1265 to 1268
function clearReactNativeBundleExecutionStartTimestamp() {
delete RN_GLOBAL_OBJ.nativePerformanceNow;
delete RN_GLOBAL_OBJ.__BUNDLE_START_TIME__;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using the delete operator for performance reasons.

Consider setting the properties to undefined instead of using delete, as this can improve performance.

-  delete RN_GLOBAL_OBJ.nativePerformanceNow;
-  delete RN_GLOBAL_OBJ.__BUNDLE_START_TIME__;
+  RN_GLOBAL_OBJ.nativePerformanceNow = undefined;
+  RN_GLOBAL_OBJ.__BUNDLE_START_TIME__ = undefined;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function clearReactNativeBundleExecutionStartTimestamp() {
delete RN_GLOBAL_OBJ.nativePerformanceNow;
delete RN_GLOBAL_OBJ.__BUNDLE_START_TIME__;
}
function clearReactNativeBundleExecutionStartTimestamp() {
RN_GLOBAL_OBJ.nativePerformanceNow = undefined;
RN_GLOBAL_OBJ.__BUNDLE_START_TIME__ = undefined;
}
Tools
Biome

[error] 1266-1266: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


[error] 1267-1267: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 764654b and 2e724f8.

Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
Files selected for processing (3)
  • CHANGELOG.md (7 hunks)
  • package.json (3 hunks)
  • src/js/tools/vendor/metro/utils.ts (2 hunks)
Files skipped from review as they are similar to previous changes (2)
  • CHANGELOG.md
  • package.json
Additional comments not posted (3)
src/js/tools/vendor/metro/utils.ts (3)

34-37: New type definition NewSourceMapStringExport is well-defined.

This type improves type safety and clarity regarding the sourceMapString structure.


83-98: Enhanced logic for sourceMapStringFunction is robust and clear.

The updated logic includes thorough type checks and clear error handling, improving robustness and developer guidance.


101-104: Call to sourceMapStringFunction aligns with updated logic.

The call correctly utilizes the newly defined logic to ensure the correct function is invoked, maintaining consistency and robustness.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2e724f8 and bb21d0b.

Files selected for processing (2)
  • CHANGELOG.md (7 hunks)
  • RNSentry.podspec (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • CHANGELOG.md
  • RNSentry.podspec

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between bb21d0b and d84c19e.

Files selected for processing (9)
  • CHANGELOG.md (7 hunks)
  • package.json (3 hunks)
  • samples/expo/app.json (2 hunks)
  • samples/expo/package.json (2 hunks)
  • samples/react-native/android/app/build.gradle (1 hunks)
  • samples/react-native/ios/sentryreactnativesample/Info.plist (1 hunks)
  • samples/react-native/ios/sentryreactnativesampleTests/Info.plist (1 hunks)
  • samples/react-native/package.json (3 hunks)
  • src/js/version.ts (1 hunks)
Files skipped from review as they are similar to previous changes (7)
  • CHANGELOG.md
  • samples/expo/app.json
  • samples/expo/package.json
  • samples/react-native/android/app/build.gradle
  • samples/react-native/ios/sentryreactnativesample/Info.plist
  • samples/react-native/package.json
  • src/js/version.ts
Additional comments not posted (6)
samples/react-native/ios/sentryreactnativesampleTests/Info.plist (1)

18-22: Version updates are appropriate.

The updates to CFBundleShortVersionString and CFBundleVersion reflect a new release version and build number, indicating significant updates or improvements.

package.json (5)

5-5: Package version update is appropriate.

The version increment from 5.22.3 to 5.28.0 indicates significant updates or improvements.


71-78: Dependency version updates are appropriate.

The updates to @sentry/browser, @sentry/core, @sentry/hub, @sentry/integrations, @sentry/react, @sentry/types, and @sentry/utils from 7.113.0 to 7.117.0 suggest coordinated improvements or fixes.


84-86: DevDependency version updates are appropriate.

The updates to @sentry-internal/eslint-config-sdk, @sentry-internal/eslint-plugin-sdk, and @sentry-internal/typescript from 7.113.0 to 7.117.0 indicate improvements or modifications in line with the new SDK versions.


110-110: React Native version update is appropriate.

The update from 0.73.2 to 0.73.9 may include important fixes or enhancements relevant to the React Native framework.


70-70: New dependency added: @sentry/babel-plugin-component-annotate.

The addition of @sentry/babel-plugin-component-annotate with version 2.20.1 likely introduces new functionality related to component annotation in Babel.

Ensure that the new dependency is compatible with the existing codebase and does not introduce any breaking changes.

Verification successful

Dependency compatibility verified: @sentry/babel-plugin-component-annotate

The @sentry/babel-plugin-component-annotate plugin is integrated into the Babel transformation process without any complex interactions or signs of compatibility issues. The usage is straightforward, and there are no indications of breaking changes.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify compatibility of the new dependency `@sentry/babel-plugin-component-annotate`.

# Test: Check for any usage of the new dependency in the codebase. Expect: No breaking changes.
rg '@sentry/babel-plugin-component-annotate'

Length of output: 1527


Script:

#!/bin/bash
# Description: Investigate the usage of `componentAnnotatePlugin` in the codebase for compatibility verification.

# Search for the usage of `componentAnnotatePlugin` in the codebase to understand its impact.
rg 'componentAnnotatePlugin' -A 5

Length of output: 1026

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d84c19e and 0909d2a.

Files selected for processing (5)
  • .github/workflows/e2e.yml (11 hunks)
  • .gitignore (1 hunks)
  • .vscode/settings.json (1 hunks)
  • scripts/e2e.mjs (1 hunks)
  • test/e2e/.gitignore (1 hunks)
Files skipped from review due to trivial changes (3)
  • .gitignore
  • .vscode/settings.json
  • test/e2e/.gitignore
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/e2e.yml
Additional context used
Biome
scripts/e2e.mjs

[error] 1-2: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)


[error] 50-50: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

Additional comments not posted (6)
scripts/e2e.mjs (6)

13-22: Argument validation and platform check look good.

The logic for validating command-line arguments and ensuring a supported platform is correctly implemented.


24-35: Action processing logic is correct.

The script correctly filters actions based on command-line arguments and logs the actions to be performed.


37-41: Setting default environment variable looks good.

The script correctly sets SENTRY_DISABLE_AUTO_UPLOAD to prevent flaky CI behavior, with a clear inline comment explaining the rationale.


43-46: Setting PRODUCTION environment variable is appropriate.

The script ensures a production build is used when running locally, which is a sensible default.


53-56: Disabling Flipper for iOS builds is sensible.

The script correctly disables Flipper to avoid known build issues, with a clear comment explaining the decision.


139-175: Build process logic is comprehensive and well-implemented.

The script includes necessary steps for building both iOS and Android platforms, with a workaround for module resolution issues.

scripts/e2e.mjs Outdated
Comment on lines 48 to 51
if (!env.USE_FRAMEWORKS || env.USE_FRAMEWORKS === 'no') {
// In case it's set to an empty string, it causes issues in Podfile.
delete env.USE_FRAMEWORKS;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using the delete operator for environment variables.

Instead of using delete, set env.USE_FRAMEWORKS to undefined to avoid performance issues.

-  delete env.USE_FRAMEWORKS;
+  env.USE_FRAMEWORKS = undefined;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (!env.USE_FRAMEWORKS || env.USE_FRAMEWORKS === 'no') {
// In case it's set to an empty string, it causes issues in Podfile.
delete env.USE_FRAMEWORKS;
}
if (!env.USE_FRAMEWORKS || env.USE_FRAMEWORKS === 'no') {
// In case it's set to an empty string, it causes issues in Podfile.
env.USE_FRAMEWORKS = undefined;
}
Tools
Biome

[error] 50-50: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

scripts/e2e.mjs Outdated
Comment on lines 1 to 2
#!/usr/bin/env node
'use strict';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove redundant 'use strict' directive.

The 'use strict' directive is unnecessary in ES modules, as they are in strict mode by default.

- 'use strict';
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#!/usr/bin/env node
'use strict';
#!/usr/bin/env node
Tools
Biome

[error] 1-2: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0909d2a and 90c5be7.

Files ignored due to path filters (1)
  • .yarn/releases/yarn-1.22.22.cjs is excluded by !**/.yarn/**
Files selected for processing (4)
  • .github/workflows/native-tests.yml (2 hunks)
  • .yarnrc (1 hunks)
  • .yarnrc.yml (1 hunks)
  • package.json (4 hunks)
Files skipped from review due to trivial changes (3)
  • .github/workflows/native-tests.yml
  • .yarnrc
  • .yarnrc.yml
Additional comments not posted (5)
package.json (5)

84-86: Verify compatibility of devDependency updates.

DevDependencies such as @sentry-internal/eslint-config-sdk and others have been updated. Ensure these changes are compatible with your development environment and do not disrupt existing workflows.


110-110: Verify the react-native version update.

The react-native version has been updated from 0.73.2 to 0.73.9. Ensure compatibility with the existing codebase and verify if any breaking changes are introduced.


5-5: Verify the update of release notes or changelog.

The version update from 5.22.3 to 5.28.0 suggests significant changes. Ensure that the release notes or changelog are updated to reflect these changes.

Verification successful

Changelog Updated for Version 5.28.0

The changelog has been updated to include the new version 5.28.0, confirming that the release notes are documented. No further action is required.

  • Entry found in CHANGELOG.md for version 5.28.0.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if the changelog or release notes have been updated for the new version.

# Test: Search for the version number in changelog or release notes. Expect: The new version is documented.
rg --type markdown --type text '5.28.0'

Length of output: 68


Script:

#!/bin/bash
# Description: Verify if the changelog or release notes have been updated for the new version.

# Corrected Test: Search for the version number in markdown and txt files. Expect: The new version is documented.
rg --type markdown --type txt '5.28.0'

Length of output: 141


70-78: Review the dependency updates.

Dependencies such as @sentry/browser, @sentry/core, and others have been updated to version 7.117.0. Ensure compatibility with the existing codebase and verify if any breaking changes are introduced.


70-70: Evaluate the addition of @sentry/babel-plugin-component-annotate.

A new dependency @sentry/babel-plugin-component-annotate has been added. Ensure that its purpose is well-documented and integrated properly into the project.

Verification successful

Integration of @sentry/babel-plugin-component-annotate is properly implemented.

The @sentry/babel-plugin-component-annotate is effectively integrated into the Babel transformation process via the sentryBabelTransformer.ts file. This setup ensures that the plugin is utilized to enhance component annotations as intended. No further action is required.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the integration and purpose of the new dependency `@sentry/babel-plugin-component-annotate`.

# Test: Search for the usage or documentation of the new dependency in the codebase.
rg '@sentry/babel-plugin-component-annotate'

Length of output: 1527


Script:

#!/bin/bash
# Search for the configuration or usage of `@sentry/babel-plugin-component-annotate` in Babel or build configuration files.
rg '@sentry/babel-plugin-component-annotate' --glob '**/babel.config.*' --glob '**/webpack.config.*' --glob '**/rollup.config.*'

Length of output: 128


Script:

#!/bin/bash
# Display the content of `sentryBabelTransformer.ts` to understand the usage of `@sentry/babel-plugin-component-annotate`.
rg 'componentAnnotatePlugin' -A 20 src/js/tools/sentryBabelTransformer.ts

Length of output: 1184

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 90c5be7 and b645aa9.

Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
Files selected for processing (2)
  • CHANGELOG.md (7 hunks)
  • package.json (4 hunks)
Files skipped from review as they are similar to previous changes (1)
  • CHANGELOG.md
Additional comments not posted (5)
package.json (5)

5-5: Version update approved.

The version update from 5.22.3 to 5.28.0 follows semantic versioning and likely includes new features or improvements.


84-86: DevDependency updates approved, but verify for workflow impact.

The updates to @sentry-internal/eslint-config-sdk, @sentry-internal/eslint-plugin-sdk, and @sentry-internal/typescript from 7.113.0 to 7.118.0 align with the main dependency updates.

However, ensure these updates do not negatively impact development workflows.


110-110: React Native version update approved, but verify compatibility.

The update from 0.73.2 to 0.73.9 is a patch update likely including bug fixes or minor improvements.

However, ensure compatibility with the rest of the codebase.


71-78: Dependency updates approved, but verify for breaking changes.

The updates to @sentry/browser, @sentry/core, @sentry/hub, @sentry/integrations, @sentry/react, @sentry/types, and @sentry/utils from 7.113.0 to 7.118.0 are likely enhancements or bug fixes.

However, ensure these updates do not introduce breaking changes.

Verification successful

No breaking changes found in Sentry package updates.

The updates to Sentry packages (@sentry/browser, @sentry/core, @sentry/hub, @sentry/integrations, @sentry/react, @sentry/types, @sentry/utils) to version 7.118.0 do not introduce any breaking changes according to their changelogs.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify for breaking changes in updated dependencies.

# Test: Check changelogs for breaking changes. Expect: No breaking changes.
for package in @sentry/browser @sentry/core @sentry/hub @sentry/integrations @sentry/react @sentry/types @sentry/utils; do
  echo "Checking changelog for $package..."
  # Assuming changelogs are accessible in the repository
  rg --files-with-matches "BREAKING CHANGE" "node_modules/$package/CHANGELOG.md"
done

Length of output: 2641


Script:

#!/bin/bash
# Description: Check changelogs for breaking changes in Sentry packages from their GitHub repository.

# List of packages and their new versions
declare -A packages=(
  ["browser"]="7.118.0"
  ["core"]="7.118.0"
  ["hub"]="7.118.0"
  ["integrations"]="7.118.0"
  ["react"]="7.118.0"
  ["types"]="7.118.0"
  ["utils"]="7.118.0"
)

# Base URL for Sentry GitHub repository
base_url="https://raw.githubusercontent.com/getsentry/sentry-javascript"

# Check each package for breaking changes in the changelog
for package in "${!packages[@]}"; do
  version="${packages[$package]}"
  echo "Checking changelog for @$package@$version..."
  # Fetch the changelog from GitHub and search for breaking changes
  changelog_url="$base_url/master/packages/$package/CHANGELOG.md"
  curl -s "$changelog_url" | rg "## \[$version\]" -A 10 | rg "BREAKING CHANGE"
done

Length of output: 3182


70-70: Verify the new dependency addition.

The addition of @sentry/babel-plugin-component-annotate at version 2.20.1 should be verified for necessity and compatibility with the existing setup.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b645aa9 and 53f7698.

Files selected for processing (4)
  • CHANGELOG.md (7 hunks)
  • src/js/tracing/reactnavigation.ts (6 hunks)
  • src/js/tracing/utils.ts (2 hunks)
  • test/tracing/reactnavigation.ttid.test.tsx (3 hunks)
Files skipped from review as they are similar to previous changes (2)
  • CHANGELOG.md
  • test/tracing/reactnavigation.ttid.test.tsx
Additional comments not posted (6)
src/js/tracing/utils.ts (3)

133-148: LGTM!

The getBundleStartTimestampMs function is well-implemented, with proper handling and logging for missing bundle start time.


115-126: LGTM!

The setSpanDurationAsMeasurementOnTransaction function is correctly implemented, ensuring measurements are set only when timestamps are available.


103-109: LGTM!

The setSpanDurationAsMeasurement function is well-implemented, ensuring measurements are set only when timestamps are available.

src/js/tracing/reactnavigation.ts (3)

14-19: LGTM!

The import statement for setSpanDurationAsMeasurementOnTransaction is correctly added and aligns with the changes in the utilities.


Line range hint 232-300: Improved transaction handling logic.

The use of setSpanDurationAsMeasurementOnTransaction enhances the clarity and efficiency of span duration measurement.


Line range hint 20-377: Enhanced transaction management in ReactNavigationInstrumentation.

The updates improve the clarity and efficiency of the class by streamlining transaction and span handling.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 53f7698 and 79930f1.

Files selected for processing (3)
  • CHANGELOG.md (7 hunks)
  • src/js/tracing/timetodisplay.tsx (6 hunks)
  • test/tracing/timetodisplay.test.tsx (3 hunks)
Files skipped from review as they are similar to previous changes (3)
  • CHANGELOG.md
  • src/js/tracing/timetodisplay.tsx
  • test/tracing/timetodisplay.test.tsx

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 79930f1 and 1ee969d.

Files selected for processing (3)
  • CHANGELOG.md (7 hunks)
  • src/js/utils/normalize.ts (1 hunks)
  • test/utils/normalize.test.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • CHANGELOG.md
Additional comments not posted (3)
src/js/utils/normalize.ts (1)

11-18: Enhancement in object validation logic.

The changes improve type safety by ensuring that only plain objects are returned as normalized objects. This is achieved by checking that normalized is not an array and is an instance of Object.

Verify that this enhanced logic does not impact other parts of the codebase that rely on convertToNormalizedObject.

Verification successful

Enhanced logic in convertToNormalizedObject is compatible with existing code.

The enhanced object validation logic in convertToNormalizedObject does not negatively impact its usage in the codebase. The function is used in src/js/scope.ts and is well-tested in test/utils/normalize.test.ts, covering various input scenarios. No incompatible usages were found.

  • Usage in Code: src/js/scope.ts
  • Test Coverage: test/utils/normalize.test.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify usage of `convertToNormalizedObject` to ensure compatibility with the new logic.

# Test: Search for function usage. Expect: No incompatible usages.
rg --type typescript -A 5 $'convertToNormalizedObject'

Length of output: 88


Script:

#!/bin/bash
# Description: Verify usage of `convertToNormalizedObject` to ensure compatibility with the new logic.

# Test: Search for function usage in TypeScript files. Expect: No incompatible usages.
rg 'convertToNormalizedObject' --glob '*.ts' -A 5

Length of output: 3345

test/utils/normalize.test.ts (2)

25-28: Test case for array input.

The test case correctly verifies that an array input is converted to an object with the value property set to the array.


30-35: Test case for custom class instance.

The test case ensures that an instance of a custom class is converted into an object reflecting its properties. This enhances test coverage for non-plain objects.

Verify that the test suite covers all necessary scenarios for convertToNormalizedObject.

Verification successful

Comprehensive Test Coverage for convertToNormalizedObject Verified

The test suite includes a variety of scenarios for convertToNormalizedObject, ensuring robust coverage. These tests handle normalized objects, special values like NaN, strings, nulls, arrays, and custom class instances.

  • Located in test/utils/normalize.test.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify test coverage for `convertToNormalizedObject`.

# Test: Check for test cases. Expect: Comprehensive coverage.
rg --type typescript -A 5 $'describe\\(\\s*[\'"]convertToNormalizedObject[\'"]'

Length of output: 117


Script:

#!/bin/bash
# Description: Verify test coverage for `convertToNormalizedObject`.

# Test: Check for test cases related to `convertToNormalizedObject`.
rg 'convertToNormalizedObject' -A 5

Length of output: 3331

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (2)
test/tracing/timetodisplaynative.web.test.tsx (1)

17-27: Tests are well-structured and meaningful.

The test cases effectively verify the expected behavior of the timetodisplaynative module.

Consider adding more descriptive test names.

While the current names are functional, more descriptive names could enhance readability and maintainability.

-  test('requireNativeComponent to be undefined', () => {
+  test('ReactNativeLibraries requireNativeComponent should be undefined', () => {
-  test('getRNSentryOnDrawReporter returns Noop', () => {
+  test('getRNSentryOnDrawReporter should return Noop when native component is unavailable', () => {
src/js/tracing/timetodisplaynative.tsx (1)

31-35: Robust handling of native component availability.

The logic for getRNSentryOnDrawReporter handles the absence of the native component gracefully, improving reliability.

Consider adding comments for clarity.

Adding comments to explain the purpose of nativeComponentExists and the fallback logic could improve code readability.

+// Check if the native component is available
export const nativeComponentExists = UIManager.hasViewManagerConfig
  ? UIManager.hasViewManagerConfig(RNSentryOnDrawReporterClass)
  : false;

+// Initialize the native component or fallback to Noop
export const getRNSentryOnDrawReporter = (): typeof RNSentryOnDrawReporter => {
  if (!RNSentryOnDrawReporter) {
    RNSentryOnDrawReporter = nativeComponentExists && ReactNativeLibraries.ReactNative?.requireNativeComponent
      ? ReactNativeLibraries.ReactNative.requireNativeComponent(RNSentryOnDrawReporterClass)
      : RNSentryOnDrawReporterNoop;
  }
  return RNSentryOnDrawReporter;
}
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1ee969d and 8f05739.

Files selected for processing (15)
  • CHANGELOG.md (7 hunks)
  • android/build.gradle (1 hunks)
  • package.json (4 hunks)
  • samples/expo/app.json (2 hunks)
  • samples/expo/package.json (2 hunks)
  • samples/react-native/android/app/build.gradle (1 hunks)
  • samples/react-native/ios/sentryreactnativesample/Info.plist (1 hunks)
  • samples/react-native/ios/sentryreactnativesampleTests/Info.plist (1 hunks)
  • samples/react-native/package.json (3 hunks)
  • src/js/tracing/timetodisplaynative.tsx (2 hunks)
  • src/js/utils/rnlibraries.ts (2 hunks)
  • src/js/utils/rnlibrariesinterface.ts (2 hunks)
  • src/js/vendor/react-native/index.ts (1 hunks)
  • src/js/version.ts (1 hunks)
  • test/tracing/timetodisplaynative.web.test.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (9)
  • CHANGELOG.md
  • android/build.gradle
  • samples/expo/package.json
  • samples/react-native/android/app/build.gradle
  • samples/react-native/ios/sentryreactnativesample/Info.plist
  • src/js/utils/rnlibraries.ts
  • src/js/utils/rnlibrariesinterface.ts
  • src/js/vendor/react-native/index.ts
  • src/js/version.ts
Additional comments not posted (14)
samples/react-native/ios/sentryreactnativesampleTests/Info.plist (1)

18-22: Version and build number updates approved.

The updates to CFBundleShortVersionString and CFBundleVersion reflect a new release, which is a common practice for versioning.

test/tracing/timetodisplaynative.web.test.tsx (1)

1-5: Mocks set up correctly.

The use of Jest mocks for react-native and rnlibraries is appropriate for isolating the tests.

src/js/tracing/timetodisplaynative.tsx (1)

2-5: Improved modularity with centralized component access.

The use of ReactNativeLibraries to access requireNativeComponent enhances modularity and maintainability.

samples/expo/app.json (1)

7-7: Version and build number updates are consistent.

The updates to the version and build numbers are correctly applied, indicating a new release with enhancements or features.

Also applies to: 22-22, 30-30

samples/react-native/package.json (5)

3-3: Project version update is consistent.

The project version has been updated correctly, reflecting potential enhancements or bug fixes.


29-29: React Native and macOS version updates are consistent.

The updates to react-native and react-native-macos versions are appropriate and align with the project's needs.

Also applies to: 31-31


44-44: DevDependencies updates are consistent.

The updates to @react-native/babel-preset, @react-native/eslint-config, and @react-native/metro-config are appropriate for maintaining compatibility and functionality.

Also applies to: 45-45, 46-46


48-48: New devDependency added: Verify its impact.

The addition of @sentry/babel-plugin-component-annotate should be verified to ensure it is necessary and correctly integrated.


32-32: New dependencies added: Verify their impact.

The addition of react-native-reanimated and react-native-svg should be verified to ensure they are necessary and correctly integrated.

Also applies to: 35-35

Verification successful

Dependencies Verified: react-native-reanimated and react-native-svg are actively used.

  • react-native-reanimated is imported in samples/react-native/src/App.tsx.
  • react-native-svg is used in samples/react-native/src/components/SvgGraphic.tsx and referenced in samples/react-native/src/Screens/PlaygroundScreen.tsx.

Both dependencies are necessary and correctly integrated into the project.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of new dependencies in the codebase.

# Test: Search for usage of `react-native-reanimated` and `react-native-svg`.
rg --type js 'react-native-reanimated' -A 5
rg --type js 'react-native-svg' -A 5

Length of output: 237


Script:

#!/bin/bash
# Description: Further verify the usage of new dependencies in the codebase.

# Test: Search for usage of `react-native-reanimated` and `react-native-svg` in JSX and TypeScript files.
rg --type jsx 'react-native-reanimated' -A 5
rg --type ts 'react-native-reanimated' -A 5
rg --type jsx 'react-native-svg' -A 5
rg --type ts 'react-native-svg' -A 5

# Additionally, check for any configuration files that might reference `react-native-svg`.
rg 'react-native-svg' --type yaml --type json --type toml -A 5

Length of output: 2336

package.json (5)

5-5: Package version update is consistent.

The package version has been updated correctly, reflecting potential enhancements or bug fixes.


70-78: Sentry dependencies updates are consistent.

The updates to Sentry dependencies are appropriate and align with the project's needs for improved functionality and compatibility.


84-86: Internal Sentry devDependencies updates are consistent.

The updates to internal Sentry devDependencies are appropriate for maintaining compatibility and functionality.


110-110: React Native version update is consistent.

The update to the react-native version is appropriate and aligns with the project's needs.


134-134: Package manager specification is appropriate.

The addition of the package manager specification ensures consistency in dependency management.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (3)
CHANGELOG.md (3)

5-6: Clarify the deprecation note.

The note about deprecating enableSpotlight and spotlightSidecarUrl could be clearer. Consider specifying the impact or recommended alternatives.

-  - Deprecating `enableSpotlight` and `spotlightSidecarUrl`
+  - Deprecating `enableSpotlight` and `spotlightSidecarUrl`. Consider using the new `spotlight` option for similar functionality.

35-37: Clarify the stack trace change.

The change regarding Sentry.captureMessage stack trace location could benefit from additional context about the impact on users.

-  - To revert to the old behavior (causing the stack to be unsymbolicated) use `useThreadsForMessageStack` option
+  - To revert to the old behavior, where the stack might be unsymbolicated, use the `useThreadsForMessageStack` option.

49-50: Clarify the app start data change.

The entry about dropping app start data could specify the reason or benefit of this change.

-  - Drop app start data older than one minute
+  - Drop app start data older than one minute to improve performance and reduce memory usage.
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8f05739 and 7b891b1.

Files selected for processing (6)
  • CHANGELOG.md (7 hunks)
  • samples/expo/app/_layout.tsx (2 hunks)
  • samples/react-native/src/App.tsx (6 hunks)
  • src/js/integrations/default.ts (4 hunks)
  • src/js/options.ts (3 hunks)
  • test/sdk.test.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • samples/expo/app/_layout.tsx
Additional comments not posted (15)
src/js/integrations/default.ts (2)

111-113: Consolidate spotlight and enableSpotlight logic.

The logic for determining the sidecarUrl based on spotlight and enableSpotlight options is well-structured. Ensure that the sidecarUrl is correctly set in all cases.


116-124: Conditional replay integration logic is sound.

The conditional logic for adding replay integrations based on _experiments is correctly implemented. Ensure that the _experiments object is always populated as expected in the calling code.

src/js/options.ts (3)

Line range hint 169-184:
Deprecation notices for enableSpotlight and spotlightSidecarUrl.

The deprecation comments are clear, guiding users towards using the spotlight option instead. Ensure that documentation is updated accordingly.


207-231: Introduction of _experiments property.

The _experiments property is a flexible way to handle experimental features. Ensure that this property is used consistently across the codebase and that experimental features are properly documented.


233-239: Deprecation notice for useThreadsForMessageStack.

The deprecation notice is clear. Ensure that users are aware of the alternative approach using beforeSend.

samples/react-native/src/App.tsx (7)

9-15: Integration of react-native-reanimated is correct.

The imports from react-native-reanimated are correctly set up for animation purposes. Ensure that the library is correctly installed and configured in the project.


34-35: Addition of PlaygroundScreen and logWithoutTracing.

The new screen and logging utility are integrated correctly. Ensure that logWithoutTracing is defined and used consistently across the codebase.


53-65: Improved logging in Sentry initialization.

Using logWithoutTracing for logging in the Sentry configuration is a good practice to reduce console clutter. Ensure that sensitive information is not logged.


229-244: Addition of PlaygroundTab.

The new tab screen is a useful addition. Ensure that the PlaygroundScreen component is fully functional and tested.


251-257: RunningIndicator component logic is sound.

The component correctly checks the platform before rendering the RotatingBox. Ensure that this logic aligns with the intended user experience.


259-282: RotatingBox component implementation.

The animation logic using react-native-reanimated is well-implemented. Consider the performance impact of continuous animations and test on multiple devices.


288-298: Styling for RotatingBox.

The styles are straightforward and suitable for the component's functionality. Ensure that these styles do not conflict with other components.

test/sdk.test.ts (3)

Line range hint 435-439:
LGTM: Spotlight integration with enableSpotlight.

The test case correctly verifies the addition of the spotlight integration when enableSpotlight is set to true.


445-453: LGTM: Spotlight integration with boolean spotlight.

The test case correctly verifies the addition of the spotlight integration when spotlight is set to true.


455-463: LGTM: Spotlight integration with direct URL.

The test case correctly verifies the addition of the spotlight integration when a direct URL is provided.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7b891b1 and 677106a.

Files selected for processing (1)
  • RNSentry.podspec (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • RNSentry.podspec

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 677106a and ea74161.

Files selected for processing (1)
  • CHANGELOG.md (7 hunks)
Files skipped from review as they are similar to previous changes (1)
  • CHANGELOG.md

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (7)
CHANGELOG.md (7)

7-8: Clarify deprecation details for spotlight option.

The deprecation of enableSpotlight and spotlightSidecarUrl should clearly indicate if there are any migration steps or alternatives.

-  - Deprecating `enableSpotlight` and `spotlightSidecarUrl`
+  - Deprecating `enableSpotlight` and `spotlightSidecarUrl`. Please refer to the migration guide for alternatives.

12-17: Ensure consistency in dependency update descriptions.

The entries for dependency updates should consistently mention the purpose or impact of the update, if applicable.

-  - Bump JavaScript SDK from v7.118.0 to v7.119.0
+  - Bump JavaScript SDK from v7.118.0 to v7.119.0 for improved performance and bug fixes

23-23: Provide context for display spans feature.

The feature description for TimeToInitialDisplay and TimeToFullDisplay should include what these metrics help achieve.

-  - `TimeToInitialDisplay` and `TimeToFullDisplay` start the time to display spans on mount
+  - `TimeToInitialDisplay` and `TimeToFullDisplay` start the time to display spans on mount, helping measure component rendering performance

29-30: Clarify data type expectations in fix description.

The fix for the crash when passing an array should specify the expected data structure.

-  - The expected `data` type is plain JS object, otherwise the data might be lost.
+  - The expected `data` type is a plain JavaScript object. Passing an array or other types may result in data loss.

46-47: Clarify the impact of the sourceMapString support.

The fix for [email protected] should explain what the sourceMapString export enables or improves.

-  - Support `[email protected]` new `sourceMapString` export
+  - Support `[email protected]` new `sourceMapString` export, enhancing source map handling and debugging

60-61: Clarify the rationale for dropping old app start data.

The fix description should explain why app start data older than one minute is dropped.

-  - Drop app start data older than one minute
+  - Drop app start data older than one minute to ensure accurate performance metrics

77-79: Provide context for enabling Session Replay.

The feature description should clarify the benefits of using replaysSessionSampleRate and replaysOnErrorSampleRate.

-  To enable Replay use the `replaysSessionSampleRate` or `replaysOnErrorSampleRate` options.
+  To enable Replay, use the `replaysSessionSampleRate` or `replaysOnErrorSampleRate` options to capture and analyze user interactions.
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ea74161 and d5f0e5a.

Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
Files selected for processing (2)
  • CHANGELOG.md (7 hunks)
  • package.json (4 hunks)
Additional comments not posted (6)
package.json (6)

5-5: Verify compatibility with the new package version.

The version update from 5.22.3 to 5.29.0 indicates significant changes. Ensure that these changes are compatible with the rest of the project. Reviewing the changelog for this version is recommended to understand the new features, bug fixes, or improvements.


70-70: Verify the necessity and compatibility of the new dependency.

The addition of @sentry/babel-plugin-component-annotate at version 2.20.1 suggests new functionality. Ensure that this dependency is necessary and compatible with the existing Babel configuration.


71-78: Verify compatibility of updated Sentry dependencies.

The @sentry dependencies have been updated from 7.113.0 to 7.119.0. Ensure these updates are compatible with the rest of the codebase and do not introduce breaking changes. Checking the release notes for these updates is recommended.


84-86: Verify compatibility of updated internal devDependencies.

The @sentry-internal devDependencies have been updated from 7.113.0 to 7.119.0. Ensure these updates are compatible with the development environment and do not introduce any issues.


110-110: Verify compatibility with the new React Native version.

The version update from 0.73.2 to 0.73.9 may include important fixes or enhancements. Ensure that this update is compatible with the rest of the project and that any breaking changes are addressed. Reviewing the changelog for this version is recommended.


134-134: Verify compatibility of the specified Yarn version.

The addition of "packageManager": "[email protected]" specifies the package manager used for the project. Ensure that this version of Yarn is compatible with the project's dependencies and build processes.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (12)
CHANGELOG.md (12)

7-8: Clarify deprecation details.

The entry mentions the deprecation of enableSpotlight and spotlightSidecarUrl. Ensure that the implications of these deprecations are clear to users, possibly by linking to documentation or providing migration guidance.


23-23: Clarify feature introduction.

The introduction of TimeToInitialDisplay and TimeToFullDisplay is noted. Consider adding a brief explanation or link to documentation on how these features enhance performance metrics.


27-30: Ensure clarity in fix descriptions.

The fix for TTID mentions "regardless current active span." Clarify this statement to ensure users understand the context and impact of the fix.


46-48: Clarify stack trace behavior change.

The movement of the stack trace for Sentry.captureMessage is noted. Consider providing guidance on how users can adapt to this change if it affects their current setup.


77-79: Highlight beta status for new features.

The Session Replay feature is marked as a public beta. Ensure this status is clearly communicated to users to set expectations about stability and support.


81-90: Provide example context for new features.

The code snippet for enabling Replay provides a good example. Consider adding a brief explanation of the context or expected outcome when using this configuration.


140-141: Clarify feature scope and impact.

The improvement to Touch Event Breadcrumb components is noted. Consider explaining how this change impacts user experience or integration with other features.


145-145: Clarify error handling behavior.

The change to mechanism.handled:false is mentioned. Ensure that users understand the implications of this change on error handling and session management.


199-200: Clarify feature details.

The addition of native application start spans is noted. Consider providing more detail on how this affects app start measurement and any potential impact on performance tracking.


327-327: Highlight early access limitations.

The Mobile Session Replay Alpha is limited to early access organizations. Ensure this limitation is clearly communicated to users interested in this feature.


340-354: Provide configuration guidance.

The example for changing default Mobile Replay options is useful. Consider adding notes on best practices or potential pitfalls when configuring these options.


874-874: Link to changelog section is invalid.

The link to the changelog section #7690 does not point to a valid section in the CHANGELOG.md file. Please update the link to ensure it directs users to the correct information.

Analysis chain

Ensure external link accuracy.

The link to the changelog for the JS Performance API should be verified to ensure it directs users to the correct information.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the external link for the JS Performance API changelog.

# Test: Check if the URL is reachable and points to the correct section.
curl -Is https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#7690 | head -n 1

Length of output: 112


Script:

#!/bin/bash
# Check if the section 7690 exists in the CHANGELOG.md file.
rg '#7690' CHANGELOG.md -A 5

Length of output: 719

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d5f0e5a and 8d08908.

Files selected for processing (9)
  • CHANGELOG.md (7 hunks)
  • package.json (4 hunks)
  • samples/expo/app.json (2 hunks)
  • samples/expo/package.json (2 hunks)
  • samples/react-native/android/app/build.gradle (1 hunks)
  • samples/react-native/ios/sentryreactnativesample/Info.plist (1 hunks)
  • samples/react-native/ios/sentryreactnativesampleTests/Info.plist (1 hunks)
  • samples/react-native/package.json (3 hunks)
  • src/js/version.ts (1 hunks)
Files skipped from review as they are similar to previous changes (4)
  • samples/expo/package.json
  • samples/react-native/android/app/build.gradle
  • samples/react-native/ios/sentryreactnativesample/Info.plist
  • src/js/version.ts
Additional comments not posted (18)
samples/react-native/ios/sentryreactnativesampleTests/Info.plist (1)

18-22: Version and build number updates are correct.

The updates to CFBundleShortVersionString and CFBundleVersion are appropriate for reflecting a new version and build of the application.

samples/expo/app.json (1)

Line range hint 7-30: Version and build configuration updates are correct.

The updates to version, buildNumber, and versionCode reflect the new release and are appropriate for both iOS and Android platforms.

samples/react-native/package.json (3)

3-3: Project version update is correct.

The update to the project version from 5.22.3 to 5.30.0 is appropriate for reflecting enhancements or bug fixes.


29-35: Dependency updates are appropriate.

The updates to react-native, react-native-macos, and the addition of react-native-reanimated and react-native-svg are suitable for enhancing functionality and compatibility.


44-48: DevDependency updates and additions are correct.

The updates to @react-native/babel-preset, @react-native/eslint-config, @react-native/metro-config, and the addition of @sentry/babel-plugin-component-annotate reflect ongoing maintenance and compatibility improvements.

package.json (6)

5-5: Version update approved.

The version update from 5.22.3 to 5.30.0 suggests significant improvements or new features.


134-134: Package manager field addition approved: Verify version appropriateness.

The addition of "packageManager": "[email protected]" is approved. Ensure that this version is suitable for the project's requirements and build processes.


70-70: New dependency added: Verify necessity.

The addition of @sentry/babel-plugin-component-annotate at version 2.20.1 is noted. Ensure that this new dependency is necessary for the project's objectives.

Verification successful

Dependency usage confirmed: @sentry/babel-plugin-component-annotate is necessary.

The new dependency @sentry/babel-plugin-component-annotate is actively used in the codebase, as evidenced by its import in src/js/tools/sentryBabelTransformer.ts and a related comment in src/js/touchevents.tsx. This confirms its necessity for the project.

  • src/js/tools/sentryBabelTransformer.ts: Direct import of the plugin.
  • src/js/touchevents.tsx: Comment indicating its purpose.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the new dependency `@sentry/babel-plugin-component-annotate`.

# Test: Search for usage of the new dependency. Expect: Relevant usage in the codebase.
rg --type js --type ts '@sentry/babel-plugin-component-annotate'

Length of output: 264


84-86: DevDependency updates approved: Verify development impact.

The updates to internal Sentry devDependencies from 7.113.0 to 7.119.0 are approved. Ensure these changes do not adversely affect the development environment or processes.


110-110: React Native version update approved: Verify compatibility.

The update of react-native from 0.73.2 to 0.73.9 is approved. Ensure this update is compatible with the project's existing codebase and dependencies.


71-78: Dependency updates approved: Verify compatibility.

The updates to the Sentry SDK components from 7.113.0 to 7.119.0 are approved. Ensure that these updates are compatible with the project's existing codebase.

CHANGELOG.md (7)

3-4: Ensure consistency in version headings.

The version heading for 5.30.0 is consistent with the format used throughout the document. Ensure this consistency is maintained across all version entries.


125-125: Link to documentation for extended learning.

The link to Sentry's Mobile Session Replay documentation is a good practice. Ensure that all new features with complex setups have similar references to help users.


224-224: Highlight critical fixes.

The fix for failing iOS builds is crucial. Ensure this is clearly communicated to users who may have been affected by this issue.


234-234: Add warning for non-functional release.

The note about the non-functional iOS build in release 5.23.0 is important. Ensure users are aware and guided to use a newer version.


357-357: Encourage early access sign-up.

The link to the waitlist for Mobile Replay is a good call to action. Ensure users interested in early access are encouraged to sign up.


12-17: Verify dependency version updates.

The JavaScript SDK and Cocoa SDK updates are noted with links to changelogs and diffs. Verify that these links are correct and lead to the appropriate sections for the mentioned versions.

Verification successful

Dependency version updates verified.

The URLs for the JavaScript SDK and Cocoa SDK updates in the changelog are reachable and point to the correct sections, as indicated by the HTTP 200 status codes. No further action is required.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the changelog and diff links for JavaScript SDK and Cocoa SDK updates.

# Test: Check if the URLs are reachable and point to the correct version sections.
curl -Is https://github.com/getsentry/sentry-javascript/blob/v7/CHANGELOG.md#71190 | head -n 1
curl -Is https://github.com/getsentry/sentry-javascript/compare/7.118.0...7.119.0 | head -n 1
curl -Is https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8340 | head -n 1
curl -Is https://github.com/getsentry/sentry-cocoa/compare/8.33.0...8.34.0 | head -n 1

Length of output: 425


35-40: Verify dependency version updates.

The JavaScript SDK and Android SDK updates are noted with links to changelogs and diffs. Verify that these links are correct and lead to the appropriate sections for the mentioned versions.

Verification successful

Dependency version updates have been verified.

The links provided for the JavaScript SDK and Android SDK updates in the changelog are valid and accessible. They return a 200 HTTP status code, indicating that the pages exist.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the changelog and diff links for JavaScript SDK and Android SDK updates.

# Test: Check if the URLs are reachable and point to the correct version sections.
curl -Is https://github.com/getsentry/sentry-javascript/blob/v7/CHANGELOG.md#71180 | head -n 1
curl -Is https://github.com/getsentry/sentry-javascript/compare/7.117.0...7.118.0 | head -n 1
curl -Is https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7140 | head -n 1
curl -Is https://github.com/getsentry/sentry-java/compare/7.13.0...7.14.0 | head -n 1

Length of output: 423

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8d08908 and 1ffdfff.

Files selected for processing (3)
  • .github/actions/disk-cleanup/action.yml (1 hunks)
  • .github/workflows/e2e.yml (14 hunks)
  • .github/workflows/native-tests.yml (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/e2e.yml
Additional comments not posted (4)
.github/actions/disk-cleanup/action.yml (1)

8-19: Caution: Use of sudo to remove directories.

The action uses sudo to remove several directories, which can have security implications. Ensure that these directories are safe to remove and that their removal does not affect other workflows or critical system components. Consider documenting the purpose of each directory removal to provide context and justification.

.github/workflows/native-tests.yml (3)

18-18: Updated action version for styfle/cancel-workflow-action.

The action version has been updated to 0.12.1. Ensure that this update does not introduce any breaking changes or unexpected behavior in the workflow.


66-66: Review the impact of the disk cleanup step.

The disk cleanup step has been added to the workflow. Verify that this step does not interfere with the workflow's execution and that it effectively frees up necessary disk space without removing critical files.


92-92: Updated action version for reactivecircus/android-emulator-runner.

The action version has been updated to v2.31.0. Ensure that this update does not introduce any breaking changes or unexpected behavior in the workflow.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1ffdfff and baa882f.

Files selected for processing (2)
  • .github/workflows/e2e.yml (14 hunks)
  • .github/workflows/native-tests.yml (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/e2e.yml
Additional comments not posted (2)
.github/workflows/native-tests.yml (2)

18-18: Update to styfle/cancel-workflow-action.

The action version has been updated to 0.12.1. Ensure that this version is compatible with your workflow and does not introduce breaking changes.

Verification successful

Version 0.12.1 of styfle/cancel-workflow-action is valid and safe to use.

The update to version 0.12.1 has been confirmed, and no breaking changes or deprecations were identified. The update appears to be a minor or patch update. Ensure to test the workflow to verify compatibility in your specific environment.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify compatibility of the updated `styfle/cancel-workflow-action` version.

# Test: Check for breaking changes or deprecations in the release notes.
gh release view styfle/cancel-workflow-action --repo styfle/cancel-workflow-action --json body --jq '.body' | grep -i "breaking\|deprecated"

Length of output: 158


Script:

#!/bin/bash
# Description: Check for existing tags in the styfle/cancel-workflow-action repository.

# Test: List all tags to verify the existence of version 0.12.1.
gh release list --repo styfle/cancel-workflow-action

Length of output: 682


Script:

#!/bin/bash
# Description: Retrieve the latest commit message for the specified tag to check for any notes or updates.

# Test: Get the latest commit message for tag 0.12.1.
gh api repos/styfle/cancel-workflow-action/git/ref/tags/0.12.1 --jq '.object.sha' | xargs -I {} gh api repos/styfle/cancel-workflow-action/git/commits/{} --jq '.message'

Length of output: 178


92-92: Update to reactivecircus/android-emulator-runner.

The action version has been updated to v2.32.0. Ensure that this version is compatible with your workflow and does not introduce breaking changes.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (2)
scripts/e2e.mjs (2)

2-2: Remove redundant 'use strict' directive.

The 'use strict' directive is unnecessary in ES modules, as they are in strict mode by default.

- 'use strict';
Tools
Biome

[error] 1-2: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)


50-50: Avoid using the delete operator for environment variables.

Instead of using delete, set env.USE_FRAMEWORKS to undefined to avoid performance issues.

-  delete env.USE_FRAMEWORKS;
+  env.USE_FRAMEWORKS = undefined;
Tools
Biome

[error] 50-50: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between baa882f and 0abe24e.

Files selected for processing (6)
  • RNSentryAndroidTester/gradle.properties (2 hunks)
  • samples/react-native/android/gradle.properties (1 hunks)
  • scripts/e2e.mjs (1 hunks)
  • test/perf/TestAppPlain/android/gradle.properties (1 hunks)
  • test/perf/TestAppSentry/android/gradle.properties (1 hunks)
  • test/react-native/rn.patch.gradle.properties.js (1 hunks)
Files skipped from review due to trivial changes (1)
  • RNSentryAndroidTester/gradle.properties
Additional context used
Biome
scripts/e2e.mjs

[error] 1-2: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)


[error] 50-50: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

Additional comments not posted (7)
test/react-native/rn.patch.gradle.properties.js (3)

25-25: LGTM!

Reading the file content using fs.readFileSync is appropriate here, given that the subsequent operations depend on the file content.


28-38: LGTM!

The logic for checking and updating the Hermes configuration in gradle.properties is clear and efficient. The use of regex with the global flag ensures all occurrences are updated.


40-43: LGTM!

The modifications to reactNativeArchitectures and org.gradle.jvmargs are correctly implemented, ensuring the build configuration is updated as intended.

test/perf/TestAppPlain/android/gradle.properties (1)

13-13: LGTM!

Increasing the maximum heap size to 3072 MB can help improve performance for larger builds by providing more memory resources.

test/perf/TestAppSentry/android/gradle.properties (1)

13-13: LGTM!

Increasing the maximum heap size to 3072 MB can help improve performance for larger builds by providing more memory resources.

samples/react-native/android/gradle.properties (1)

13-13: LGTM!

Increasing the maximum heap size to 3072 MB can help improve performance for larger builds by providing more memory resources.

scripts/e2e.mjs (1)

53-56: LGTM!

The platform-specific configuration for iOS, including disabling Flipper, is correctly implemented.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0abe24e and 1b565f2.

Files selected for processing (2)
  • CHANGELOG.md (7 hunks)
  • RNSentry.podspec (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • RNSentry.podspec
Additional comments not posted (1)
CHANGELOG.md (1)

5-7: Changelog updates are well-documented and clear.

The changelog entries provide a comprehensive overview of the updates, features, fixes, and dependency changes across multiple versions. The documentation is clear and informative, with links to pull requests and changelogs for further details.

Also applies to: 9-109, 111-187, 189-199, 201-227, 229-237, 239-243, 245-247, 249-251, 253-255, 257-259, 261-263, 265-267, 269-271, 273-275, 277-279, 281-283, 285-287, 289-295, 297-299, 301-303, 305-307, 309-311, 313-315, 317-319, 321-323, 325-327, 329-367, 369-371, 373-375, 377-379, 381-383, 385-387, 389-391, 393-395, 397-399, 401-403, 405-407, 409-411, 413-415, 417-419, 421-423, 425-427, 429-431, 433-435, 437-439, 441-443, 445-447, 449-451, 453-455, 457-459, 461-463, 465-467, 469-471, 473-475, 477-479, 481-483, 485-487, 489-491, 493-495, 497-499, 501-503, 505-507, 509-511, 513-515, 517-519, 521-523, 525-527, 529-531, 533-535, 537-539, 541-543, 545-547, 549-551, 553-555, 557-559, 561-563, 565-567, 569-571, 573-575, 577-579, 581-583, 585-587, 589-591, 593-595, 597-599, 601-603, 605-607, 609-611, 613-615, 617-619, 621-623, 625-627, 629-631, 633-635, 637-639, 641-643, 645-647, 649-651, 653-655, 657-659, 661-663, 665-667, 669-671, 673-675, 677-679, 681-683, 685-687, 689-691, 693-695, 697-699, 701-703, 705-707, 709-711, 713-715, 717-719, 721-723, 725-727, 729-731, 733-735, 737-739, 741-743, 745-747, 749-751, 753-755, 757-759, 761-763, 765-767, 769-771, 773-775, 777-779, 781-783, 785-787, 789-791, 793-795, 797-799, 801-803, 805-807, 809-811, 813-815, 817-819, 821-823, 825-827, 829-831, 833-835, 837-839, 841-843, 845-847, 849-851, 853-855, 857-859, 861-863, 865-867, 869-871, 873-875, 877-879, 881-883, 885-887, 889-891, 893-895, 897-899, 901-903, 905-907, 909-911, 913-915, 917-919, 921-923, 925-927, 929-931, 933-935, 937-939, 941-943, 945-947, 949-951, 953-955, 957-959, 961-963, 965-967, 969-971, 973-975, 977-979, 981-983, 985-987, 989-991, 993-995, 997-999, 1001-1003, 1005-1007, 1009-1011, 1013-1015, 1017-1019, 1021-1023, 1025-1027, 1029-1031, 1033-1035, 1037-1039, 1041-1043, 1045-1047, 1049-1051, 1053-1055, 1057-1059, 1061-1063, 1065-1067, 1069-1071, 1073-1075, 1077-1079, 1081-1083, 1085-1087, 1089-1091, 1093-1095, 1097-1099, 1101-1103, 1105-1107, 1109-1111, 1113-1115, 1117-1119, 1121-1123, 1125-1127, 1129-1131, 1133-1135, 1137-1139, 1141-1143, 1145-1147, 1149-1151, 1153-1155, 1157-1159, 1161-1163, 1165-1167, 1169-1171, 1173-1175, 1177-1179, 1181-1183, 1185-1187, 1189-1191, 1193-1195, 1197-1199, 1201-1203, 1205-1207, 1209-1211, 1213-1215, 1217-1219, 1221-1223, 1225-1227, 1229-1231, 1233-1235, 1237-1239, 1241-1243, 1245-1247, 1249-1251, 1253-1255, 1257-1259, 1261-1263, 1265-1267, 1269-1271, 1273-1275, 1277-1279, 1281-1283, 1285-1287, 1289-1291, 1293-1295, 1297-1299, 1301-1303, 1305-1307, 1309-1311, 1313-1315, 1317-1319, 1321-1323, 1325-1327, 1329-1331, 1333-1335, 1337-1339, 1341-1343, 1345-1347, 1349-1351, 1353-1355, 1357-1359, 1361-1363, 1365-1367, 1369-1371, 1373-1375, 1377-1379, 1381-1383, 1385-1387, 1389-1391, 1393-1395, 1397-1399, 1401-1403, 1405-1407, 1409-1411, 1413-1415, 1417-1419, 1421-1423, 1425-1427, 1429-1431, 1433-1435, 1437-1439, 1441-1443, 1445-1447, 1449-1451, 1453-1455, 1457-1459, 1461-1463, 1465-1467, 1469-1471, 1473-1475, 1477-1479, 1481-1483, 1485-1487, 1489-1491, 1493-1495, 1497-1499, 1501-1503, 1505-1507, 1509-1511, 1513-1515, 1517-1519, 1521-1523, 1525-1527, 1529-1531, 1533-1535, 1537-1539, 1541-1543, 1545-1547, 1549-1551, 1553-1555, 1557-1559, 1561-1563, 1565-1567, 1569-1571, 1573-1575, 1577-1579, 1581-1583, 1585-1587, 1589-1591, 1593-1595, 1597-1599, 1601-1603, 1605-1607, 1609-1611, 1613-1615, 1617-1619, 1621-1623, 1625-1627, 1629-1631, 1633-1635, 1637-1639, 1641-1643, 1645-1647, 1649-1651, 1653-1655, 1657-1659, 1661-1663, 1665-1667, 1669-1671, 1673-1675, 1677-1679, 1681-1683, 1685-1687, 1689-1691, 1693-1695, 1697-1699, 1701-1703, 1705-1707, 1709-1711, 1713-1715, 1717-1719, 1721-1723, 1725-1727, 1729-1731, 1733-1735, 1737-1739, 1741-1743, 1745-1747, 1749-1751, 1753-1755, 1757-1759, 1761-1763, 1765-1767, 1769-1771, 1773-1775, 1777-1779, 1781-1783, 1785-1787, 1789-1791, 1793-1795, 1797-1799, 1801-1803, 1805-1807, 1809-1811, 1813-1815, 1817-1819, 1821-1823, 1825-1827, 1829-1831, 1833-1835, 1837-1839, 1841-1843, 1845-1847, 1849-1851, 1853-1855, 1857-1859, 1861-1863, 1865-1867, 1869-1871, 1873-1875, 1877-1879, 1881-1883, 1885-1887, 1889-1891, 1893-1895, 1897-1899, 1901-1903, 1905-1907, 1909-1911, 1913-1915, 1917-1919, 1921-1923, 1925-1927, 1929-1931, 1933-1935, 1937-1939, 1941-1943, 1945-1947, 1949-1951, 1953-1955, 1957-1959, 1961-1963, 1965-1967, 1969-1971, 1973-1975, 1977-1979, 1981-1983, 1985-1987, 1989-1991, 1993-1995, 1997-1999, 2001-2003, 2005-2007, 2009-2011, 2013-2015, 2017-2019, 2021-2023, 2025-2027, 2029-2031, 2033-2035, 2037-2039, 2041-2043, 2045-2047, 2049-2051, 2053-2055, 2057-2059, 2061-2063, 2065-2067, 2069-2071, 2073-2075, 2077-2079, 2081-2083, 2085-2087, 2089-2091, 2093-2095, 2097-2099, 2101-2103, 2105-2107, 2109-2111, 2113-2115, 2117-2119, 2121-2123, 2125-2127, 2129-2131, 2133-2135, 2137-2139, 2141-2143, 2145-2147, 2149-2151, 2153-2155, 2157-2159, 2161-2163, 2165-2167, 2169-2171, 2173-2175, 2177-2179, 2181-2183, 2185-2187, 2189-2191, 2193-2195, 2197-2199, 2201-2203, 2205-2207, 2209-2211, 2213-2215, 2217-2219, 2221-2223, 2225-2227, 2229-2231, 2233-2235, 2237-2239, 2241-2243, 2245-2247, 2249-2251, 2253-2255, 2257-2259, 2261-2263, 2265-2267, 2269-2271, 2273-2275, 2277-2279, 2281-2283, 2285-2287, 2289-2291, 2293-2295, 2297-2299, 2301-2303, 2305-2307, 2309-2311, 2313-2315, 2317-2319, 2321-2323, 2325-2327, 2329-2331, 2333-2335, 2337-2339, 2341-2343, 2345-2347, 2349-2351, 2353-2355, 2357-2359, 2361-2363, 2365-2367, 2369-2371, 2373-2375, 2377-2379, 2381-2383, 2385-2387, 2389-2391, 2393-2395, 2397-2399, 2401-2403, 2405-2407, 2409-2411, 2413-2415, 2417-2419, 2421-2423, 2425-2427, 2429-2431, 2433-2435, 2437-2439, 2441-2443, 2445-2447, 2449-2451, 2453-2455, 2457-2459, 2461-2463, 2465-2467, 2469-2471, 2473-2475, 2477-2479, 2481-2483, 2485-2487, 2489-2491, 2493-2495, 2497-2499, 2501-2503, 2505-2507, 2509-2511, 2513-2515, 2517-2519, 2521-2523, 2525-2527, 2529-2531, 2533-2535, 2537-2539, 2541-2543, 2545-2547, 2549-2551, 2553-2555, 2557-2559, 2561-2563, 2565-2567, 2569-2571, 2573-2575, 2577-2579, 2581-2583, 2585-2587, 2589-2591, 2593-2595, 2597-2599, 2601-2603, 2605-2607, 2609-2611, 2613-2615, 2617-2619, 2621-2623, 2625-2627, 2629-2631, 2633-2635, 2637-2639, 2641-2643, 2645-2647, 2649-2651, 2653-2655, 2657-2659, 2661-2663, 2665-2667, 2669-2671, 2673-2675, 2677-2679, 2681-2683, 2685-2687, 2689-2691, 2693-2695, 2697-2699, 2701-2703, 2705-2707, 2709-2711, 2713-2715, 2717-2719, 2721-2723, 2725-2727, 2729-2731, 2733-2735, 2737-2739, 2741-2743, 2745-2747, 2749-2751, 2753-2755, 2757-2759, 2761-2763, 2765-2767, 2769-2771, 2773-2775, 2777-2779, 2781-2783, 2785-2787, 2789-2791, 2793-2795, 2797-2799, 2801-2803, 2805-2807, 2809-2811, 2813-2815, 2817-2819, 2821-2823, 2825-2827, 2829-2831, 2833-2835, 2837-2839, 2841-2843, 2845-2847, 2849-2851, 2853-2855, 2857-2859, 2861-2863, 2865-2867, 2869-2871, 2873-2875, 2877-2879, 2881-2883, 2885-2887, 2889-2891, 2893-2895, 2897-2899, 2901-2903, 2905-2907, 2909-2911, 2913-2915, 2917-2919

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1b565f2 and bb34081.

Files selected for processing (3)
  • CHANGELOG.md (7 hunks)
  • RNSentry.podspec (1 hunks)
  • ios/RNSentry.mm (11 hunks)
Files skipped from review as they are similar to previous changes (2)
  • RNSentry.podspec
  • ios/RNSentry.mm
Additional comments not posted (8)
CHANGELOG.md (8)

5-7: LGTM!

The changelog entry correctly documents the fix for React iOS dependencies.


9-13: LGTM!

The changelog entry correctly documents the dependency update for the Cocoa SDK.


15-21: LGTM!

The changelog entry correctly documents the new spotlight option and the deprecation of related features.


22-29: LGTM!

The changelog entry correctly documents the dependency updates for the JavaScript SDK and Cocoa SDK.


31-36: LGTM!

The changelog entry correctly documents the new feature for display spans.


37-44: LGTM!

The changelog entry correctly documents the fixes for TTID measurements, crash fix, and requireNativeComponent.


45-52: LGTM!

The changelog entry correctly documents the dependency updates for the JavaScript SDK and Android SDK.


54-60: LGTM!

The changelog entry correctly documents the fixes for metro support, stack trace, and crash handling.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (3)
samples/react-native/src/Screens/ErrorsScreen.tsx (1)

109-115: Consider handling the result more effectively.

Logging the result to the console might not be sufficient for production use. Consider displaying the result to the user or handling it in a more meaningful way.

CHANGELOG.md (2)

7-7: Document the new feature Sentry.crashedLastRun().

Ensure that the new feature Sentry.crashedLastRun() is documented in the relevant sections of the documentation.


23-24: Document the new feature spotlight option.

Ensure that the new spotlight option is documented in the relevant sections of the documentation.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between bb34081 and 8a7b0f9.

Files selected for processing (13)
  • CHANGELOG.md (7 hunks)
  • android/src/main/java/io/sentry/react/RNSentryModuleImpl.java (13 hunks)
  • android/src/newarch/java/io/sentry/react/RNSentryModule.java (1 hunks)
  • android/src/oldarch/java/io/sentry/react/RNSentryModule.java (1 hunks)
  • ios/RNSentry.mm (12 hunks)
  • samples/react-native/src/Screens/ErrorsScreen.tsx (1 hunks)
  • src/js/NativeRNSentry.ts (3 hunks)
  • src/js/index.ts (1 hunks)
  • src/js/sdk.tsx (1 hunks)
  • src/js/vendor/react-native/index.ts (1 hunks)
  • src/js/wrapper.ts (6 hunks)
  • test/mockWrapper.ts (2 hunks)
  • test/sdk.withclient.test.ts (2 hunks)
Files skipped from review due to trivial changes (1)
  • src/js/index.ts
Files skipped from review as they are similar to previous changes (5)
  • android/src/newarch/java/io/sentry/react/RNSentryModule.java
  • android/src/oldarch/java/io/sentry/react/RNSentryModule.java
  • ios/RNSentry.mm
  • src/js/NativeRNSentry.ts
  • src/js/vendor/react-native/index.ts
Additional comments not posted (18)
test/sdk.withclient.test.ts (2)

7-9: LGTM!

The import statements are correctly updated to include crashedLastRun and NATIVE.

The code changes are approved.


52-66: LGTM!

The test suite for crashedLastRun is well-structured and covers different scenarios: true, false, and null. Each test case ensures the function behaves as expected and verifies that the mock function is called appropriately.

The code changes are approved.

test/mockWrapper.ts (2)

56-57: LGTM!

The crashedLastRun function is correctly added to the NATIVE mock interface.

The code changes are approved.


79-79: LGTM!

The crashedLastRun function is correctly initialized with a mock resolved value of false.

The code changes are approved.

src/js/sdk.tsx (1)

253-255: LGTM!

The crashedLastRun function is correctly implemented to return the result of NATIVE.crashedLastRun.

The code changes are approved.

src/js/wrapper.ts (5)

51-53: LGTM!

The new type definition is correctly implemented and enhances the flexibility of the SDK initialization.


621-632: LGTM!

The method is correctly implemented and enhances the SDK's capabilities in handling replay scenarios.


634-645: LGTM!

The method is correctly implemented and provides additional functionality for replay scenarios.


647-657: LGTM!

The method is correctly implemented and provides useful functionality for crash reporting.


206-207: LGTM! But verify the function usage in the codebase.

The method is correctly implemented and aligns with the new type definition. However, ensure that all function calls to initNativeSdk match the new signature.

Run the following script to verify the function usage:

Verification successful

Function usage is consistent with the new signature.

The initNativeSdk function is being used correctly across the codebase, with test cases covering various configurations to ensure its proper functionality. The transition to the new signature appears to have been handled well.

  • Files to note:
    • test/wrapper.test.ts: Multiple test cases using initNativeSdk.
    • src/js/wrapper.ts: Implementation aligns with the new signature.
    • src/js/client.ts: Usage consistent with expected options.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `initNativeSdk` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type javascript -A 5 $'initNativeSdk'

Length of output: 76


Script:

#!/bin/bash
# Description: Verify all function calls to `initNativeSdk` match the new signature.

# Test: Search for the function usage in TypeScript files. Expect: Only occurrences of the new signature.
rg --type typescript -A 5 $'initNativeSdk'

Length of output: 76


Script:

#!/bin/bash
# Description: Verify all function calls to `initNativeSdk` match the new signature.

# Test: Search for the function usage across all files. Expect: Only occurrences of the new signature.
rg -A 5 $'initNativeSdk'

Length of output: 13209

android/src/main/java/io/sentry/react/RNSentryModuleImpl.java (5)

110-110: LGTM!

The variable renaming improves readability and reflects its purpose more accurately.


206-208: LGTM!

The method is correctly implemented and enhances the flexibility of the Sentry configuration.


306-340: LGTM!

The method is correctly implemented and enhances the session replay capabilities.


443-446: LGTM!

The method is correctly implemented and enhances the reporting capabilities of the application.


448-459: LGTM!

The method is correctly implemented and provides additional functionality for replay scenarios.

CHANGELOG.md (3)

11-11: Verify the usage of install_modules_dependencies.

Ensure that the usage of install_modules_dependencies for React iOS dependencies is correctly implemented and tested.


15-17: Dependency update: Cocoa SDK.

The Cocoa SDK has been updated from v8.34.0 to v8.35.0. Ensure that the new version is compatible and does not introduce any breaking changes.


28-33: Dependency updates: JavaScript SDK and Cocoa SDK.

The JavaScript SDK has been updated from v7.118.0 to v7.119.0, and the Cocoa SDK has been updated from v8.33.0 to v8.34.0. Ensure that the new versions are compatible and do not introduce any breaking changes.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8a7b0f9 and 2a26ffa.

Files selected for processing (2)
  • CHANGELOG.md (7 hunks)
  • RNSentry.podspec (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • CHANGELOG.md
  • RNSentry.podspec

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2a26ffa and f68d10d.

Files selected for processing (2)
  • CHANGELOG.md (7 hunks)
  • ios/RNSentryReplay.m (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • CHANGELOG.md
  • ios/RNSentryReplay.m

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f68d10d and 133fd07.

Files selected for processing (2)
  • CHANGELOG.md (7 hunks)
  • RNSentry.podspec (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • RNSentry.podspec
Additional comments not posted (3)
CHANGELOG.md (3)

7-7: LGTM!

The addition of the Sentry.crashedLastRun() method is correctly documented.

The code changes are approved.


11-12: LGTM!

The fixes are correctly documented.

The code changes are approved.


16-18: LGTM!

The dependency updates are correctly documented.

The code changes are approved.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 133fd07 and d738710.

Files selected for processing (9)
  • CHANGELOG.md (7 hunks)
  • package.json (4 hunks)
  • samples/expo/app.json (2 hunks)
  • samples/expo/package.json (2 hunks)
  • samples/react-native/android/app/build.gradle (1 hunks)
  • samples/react-native/ios/sentryreactnativesample/Info.plist (1 hunks)
  • samples/react-native/ios/sentryreactnativesampleTests/Info.plist (1 hunks)
  • samples/react-native/package.json (3 hunks)
  • src/js/version.ts (1 hunks)
Files skipped from review as they are similar to previous changes (5)
  • CHANGELOG.md
  • samples/expo/package.json
  • samples/react-native/android/app/build.gradle
  • samples/react-native/ios/sentryreactnativesample/Info.plist
  • src/js/version.ts
Additional comments not posted (20)
samples/react-native/ios/sentryreactnativesampleTests/Info.plist (2)

18-18: Version update approved.

The version string update from 5.22.3 to 5.31.0 indicates significant changes or improvements.

The code changes are approved.


22-22: Build number update approved.

The build number update from 14 to 26 indicates a new build with potential bug fixes or enhancements.

The code changes are approved.

samples/expo/app.json (3)

7-7: Version update approved.

The version string update from 5.22.3 to 5.31.0 indicates significant changes or improvements.

The code changes are approved.


22-22: iOS build number update approved.

The iOS build number update from 7 to 19 indicates a new build with potential bug fixes or enhancements.

The code changes are approved.


30-30: Android version code update approved.

The Android version code update from 7 to 19 indicates a new build with potential bug fixes or enhancements.

The code changes are approved.

samples/react-native/package.json (9)

3-3: Project version update approved.

The project version update from 5.22.3 to 5.31.0 indicates significant changes or improvements.

The code changes are approved.


29-29: react-native dependency update approved.

The react-native dependency update from 0.73.2 to 0.73.9 likely includes bug fixes or enhancements.

The code changes are approved.


31-31: react-native-macos dependency update approved.

The react-native-macos dependency update from ^0.73.0-0 to 0.73.34 likely includes bug fixes or enhancements.

The code changes are approved.


32-32: react-native-reanimated dependency addition approved.

The addition of the react-native-reanimated dependency with version 3.8.1 likely introduces new features or functionality.

The code changes are approved.


35-35: react-native-svg dependency addition approved.

The addition of the react-native-svg dependency with version ^15.3.0 likely introduces new features or functionality.

The code changes are approved.


44-44: @react-native/babel-preset dependency update approved.

The @react-native/babel-preset dependency update from ^0.73.18 to 0.73.21 likely includes bug fixes or enhancements.

The code changes are approved.


45-45: @react-native/eslint-config dependency update approved.

The @react-native/eslint-config dependency update from ^0.73.1 to 0.73.2 likely includes bug fixes or enhancements.

The code changes are approved.


46-46: @react-native/metro-config dependency update approved.

The @react-native/metro-config dependency update from ^0.73.1 to 0.73.5 likely includes bug fixes or enhancements.

The code changes are approved.


48-48: @sentry/babel-plugin-component-annotate dependency addition approved.

The addition of the @sentry/babel-plugin-component-annotate dependency with version ^2.18.0 likely introduces new features or functionality.

The code changes are approved.

package.json (6)

5-5: Version update approved.

The version update from 5.22.3 to 5.31.0 is appropriate for significant changes.


70-70: New dependency addition approved.

The addition of @sentry/babel-plugin-component-annotate with version 2.20.1 is appropriate for new functionality.


71-78: Dependency updates approved.

The updates to @sentry/browser, @sentry/core, @sentry/hub, @sentry/integrations, @sentry/react, @sentry/types, and @sentry/utils from 7.113.0 to 7.119.0 are appropriate for enhancements or fixes.


84-86: DevDependency updates approved.

The updates to @sentry-internal/eslint-config-sdk, @sentry-internal/eslint-plugin-sdk, and @sentry-internal/typescript from 7.113.0 to 7.119.0 are appropriate for improvements or modifications to internal tools and configurations.


110-110: React Native update approved.

The update to react-native from 0.73.2 to 0.73.9 is appropriate for important fixes or enhancements.


134-134: New field addition approved.

The addition of "packageManager": "[email protected]" is appropriate for specifying the package manager used for the project.

antonis and others added 29 commits June 18, 2025 17:48
…4795)

* Adds basic form functionality

* Update imports

* Update imports

* Remove useState hook to avoid multiple react instances issues

* Move types and styles in different files

* Removes attachment button to be added back separately along with the implementation

* Add basic field validation

* Adds changelog

* Updates changelog

* Updates changelog

* Trim whitespaces from the submitted feedback

* Adds tests

* Renames FeedbackFormScreen to FeedbackForm

* Add beta label

* Extract default text to constants

* Moves constant to a separate file and aligns naming with JS

* Adds input text labels

* Close screen before sending the feedback to minimise wait time

Co-authored-by: LucasZF <[email protected]>

* Rename file for consistency

* Flatten configuration hierarchy and clean up

* Align required values with JS

* Use Sentry user email and name when set

* Simplifies email validation

* Show success alert message

* Aligns naming with JS and unmounts the form by default

* Use the minimum config without props in the changelog

* Adds development not for unimplemented function

* Show email and name conditionally

* Adds sentry branding (png logo)

* Adds sentry logo resource

* Add assets in module exports

* Revert "Add assets in module exports"

This reverts commit 5292475.

* Revert "Adds sentry logo resource"

This reverts commit d6e9229.

* Revert "Adds sentry branding (png logo)"

This reverts commit 8c56753.

* Add last event id

* Mock lastEventId

* Adds beta note in the changelog

* Autoinject feedback form

* Updates changelog

* Align colors with JS

* Update CHANGELOG.md

Co-authored-by: Krystof Woldrich <[email protected]>

* Update CHANGELOG.md

Co-authored-by: Krystof Woldrich <[email protected]>

* Update CHANGELOG.md

Co-authored-by: Krystof Woldrich <[email protected]>

* Use regular fonts for both buttons

* Handle keyboard properly

* Adds an option on whether the email should be validated

* Merge properties only once

* Loads current user data on form construction

* Remove unneeded extra padding

* Fix background color issue

* Adds feedback button

* Updates the changelog

* Fixes changelog typo

* Updates styles background color

Co-authored-by: Krystof Woldrich <[email protected]>

* Use defaultProps

* Correct defaultProps

* Adds test to verify when getUser is called

* Use smaller image

Co-authored-by: LucasZF <[email protected]>

* Add margin next to the icon

* Adds bottom spacing in the ErrorScreen so that the feedback button does not hide the scrollview buttons

* (2.2) feat: Add Feedback Form UI Branding logo (#4357)

* Adds sentry branding logo as a base64 encoded png

---------

Co-authored-by: LucasZF <[email protected]>

* Autoinject feedback form (#4370)

* Align changelog entry

* Update changelog

* Disable bouncing

* Add modal ui appearance

* Update snapshot tests

* Fix bottom margin

* Fix sheet height

* Remove extra modal border

* Do not expose modal styles

* Animate background color

* Avoid keyboard in modal

* Update changelog

* Fix changelog

* Updates comment

* Extract FeedbackButtonProps

* Add public function description to satisfy lint check

* Adds tests

* Fix tests

* Add test ids in feedback widget

* Add feedback widget button in test app

* WIP: Add feedback test

* Update snapshot tests with the added test ids

* Android happy path test

* Check field validation

* Scroll if button is not visible

* Adds accessibility labels

* Remove extended initial checks due to flakiness

* Revert "Remove extended initial checks due to flakiness"

This reverts commit fa3bdfc.

* Add hardcoded dark and light color themes

* Rename theme options

* Update snapshot tests

* Include in the feedback integration

* Fix circular dependency

* Add theme integration options

* Adds changelog

* Add comment note

* Align with JS api

* Remove unneeded line

Co-authored-by: Krystof Woldrich <[email protected]>

* Place widget button below the feedback widget shadow

* Expose showFeedbackButton/hideFeedbackButton methods

* Add dummy integration for tracking usage

* Adds button border

* Fixes tests

* Add accentBackground and accentForeground colors

* Extract integration getter in a helper function

* Adds dynamic theming support

* Add snapshot tests

* Show screenshot button UI

* Add screenshot button integration

* Add screenshot icon

* Adds Take a screenshot button in FeedbackWidget

* Updates snapshot tests

* Fix circularDepCheck

* Fix circularDepCheck

* Attache captured screenshot

* Hide the take screenshot button when there is a screenshot

* Convert uint8Array to Base64 on the native side

* ref(feedback): Extracts FeedbackWidgetProvider in a separate file

* Updates exposed comments

* Adds snapshot tests

* Disable functionality on the Web

* Add screenshot button in the sample expo app

* Adds system theme tests

* Test dynamically changed theme

* Remove showScreenshotButton and hideScreenshotButton from the exposed api

* Fix function name typo

* Adds enableTakeScreenshot option

* Adds happy flow test

* Make flow tests more granular

* Increate wait time out to fix flakiness on ci

* Reset widget state after each test

* Fix CI flakiness

* Remove flaky test

* fix(feedback): Fixes accessibility issue on iOS

* Add changelog

* Properly wrap root app component

* Handle undefined AppRegistryIntegration.onRunApplication gracefully

* Fix lint issue

* Do not validate all fields for visibility

* Take screenshots for debugging

* Revert "Take screenshots for debugging"

This reverts commit 3e361a1.

* Simplify test scenario

* Try without hiding the keyboard

* Test Feedback button

* Test screenshot capture

* Show an error if screenshot capture fails

* Test error flow

* Revert unneeded change

* Test with latest Maestro

* Revert "Test with latest Maestro"

This reverts commit e7c31bf.

* Revert "Test screenshot capture"

This reverts commit 8913ffc.

* Skip for 0.65.3

* Remove version check

* Use testId for feedback button

* Skip for 0.65.3

* Update snapshots

* Cleanup testIds and accessibility labels

* Enable for all RN versions

* Temp: remove modal supported check

* Do not use native driver for backgroundOpacity animation

* Revert "Temp: remove modal supported check"

This reverts commit e20aff2.

* Do not use native driver for backgroundOpacity animation

* Use text instead of test ids

* Separate iOS and Android tests

* test(e2e): Adds Feedback Widget Capture Screenshot Maestro E2E tests

* Update test snapshots

* Hide keyboard by tapping on the sentry logo

* Tap on the title to hide the keyboard on Android

* Tap on email label to hide the keyboard on Android

* Wait for the screen to become visible after the screenshot capture

* Extend wait timeout after taking the screenshot

* increase timeout

* Revert "increase timeout"

This reverts commit 7865f32.

* Revert "Extend wait timeout after taking the screenshot"

This reverts commit 80dea08.

* Tweak the emulator

* Revert "Tweak the emulator"

This reverts commit ff8458c.

* Try Google API emulator

---------

Co-authored-by: LucasZF <[email protected]>
Co-authored-by: Krystof Woldrich <[email protected]>
* test(e2e): Bump RN version to 0.80.0

* Remove folly_flags

* Run codegen on Android

* Fix Android codegen script

* Adds changelog

* Handle the new rndiff app structure

* Remove folly_flags conditionally
---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.29.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fix(replay): Fixes typo in unmask manager

* Add changelog
* test: Adds unit tests for SR mask/unmask managers

* Add missing import
* chore(deps): Bump appium drivers to the latest stable

* Test with latest drivers

* Update lockfile

* Revert "Update lockfile"

This reverts commit 4f95cf7.

* Revert "Test with latest drivers"

This reverts commit 0028734.
…flow (#4970)

* Use one constant for version string

* Add updater script

* Add temporary branch to test bump script

* Update version matching pattern

* Revert "Add temporary branch to test bump script"

This reverts commit 990a349.
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.1 to 3.29.2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@39edc49...181d5ee)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.29.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* chore(deps): Bump Android SDK to 7.22.6

* Update CHANGELOG.md

* pr id
…4975)

* feat: Add experimental flag `enableUnhandledCPPExceptionsV2` on iOS

* Adds changelog

* Use an RNSentryExperimentalOptions Obj-C wrapper to access the property

* Fixes lint issues
* chore(deps): Bump JS SDK to 8.55.0 in v6

* Update changelog
* chore: update scripts/update-cocoa.sh to 8.53.2

* fix(session-replay): fixes navigation breadcrumb filtering after Cocoa 8.53.2 bump (#4988)

* chore: update scripts/update-cocoa.sh to 8.53.2

* fix(session-replay): fixes navigation breadcrumb filtering after Cocoa 8.53.2 bump

* Remove duplicate changelog entry after merge

---------

Co-authored-by: GitHub <[email protected]>

---------

Co-authored-by: GitHub <[email protected]>
Co-authored-by: Antonis Lilis <[email protected]>
@pull pull bot merged commit b13b9dd into StemmlerSisters:main Jul 14, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants