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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## Unreleased

### Dependencies

- Bump CLI from v2.58.6 to v3.6.0 ([#354](https://github.com/getsentry/sentry-dart-plugin/pull/354))
- [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#360)
- [diff](https://github.com/getsentry/sentry-cli/compare/2.58.6...3.6.0)

## 3.4.0

### Dependencies
Expand Down
14 changes: 7 additions & 7 deletions lib/src/cli/_sources.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,37 @@ import 'package:sentry_dart_plugin/src/cli/sources.dart';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The legacyWebSymbolication option uses a sentry-cli command that was removed in the updated version, causing source map uploads to fail.
Severity: HIGH

Suggested Fix

Update the _executeCliForLegacySourceMaps method to use the modern sentry-cli sourcemaps upload command instead of the removed sentry-cli releases files ... upload-sourcemaps command. This will restore compatibility for the legacy web symbolication feature with the new CLI version.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: lib/src/cli/_sources.dart#L4

Potential issue: The plugin's `legacyWebSymbolication` feature invokes the `sentry-cli
releases files <release> upload-sourcemaps <folder>` command. This pull request updates
the bundled `sentry-cli` to a version where `sentry-cli releases files ...` subcommands
have been removed. Consequently, users who have `legacyWebSymbolication: true` in their
configuration will experience command-line failures when the
`_executeCliForLegacySourceMaps` method attempts to upload source maps using the
now-nonexistent command.

Did we get this right? πŸ‘ / πŸ‘Ž to inform future reviews.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The _executeCliForLegacySourceMaps function uses the releases files upload-sourcemaps command, which was removed in sentry-cli v3.0.0, breaking legacy web symbolication.
Severity: HIGH

Suggested Fix

Update the _executeCliForLegacySourceMaps function to use the new sentry-cli sourcemaps upload command, which is the recommended replacement. Alternatively, implement a version check for sentry-cli and either use the correct command based on the version or show an error if a user attempts to use legacy symbolication with an incompatible CLI version.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: lib/src/cli/_sources.dart#L4

Potential issue: The PR updates `sentry-cli` to v3.4.3, which removes the `releases
files upload-sourcemaps` command. The `_executeCliForLegacySourceMaps` function,
triggered when `legacy_web_symbolication` is set to `true`, still uses this removed
command. This will cause a runtime error when the CLI is executed, preventing source map
uploads for users who have opted into this legacy mode. The failure will break
symbolication for their web builds. The code does not contain any version checking or
fallback logic to handle this breaking change introduced by the `sentry-cli` update.

import 'host_platform.dart';

const _version = '2.58.6';
const _version = '3.6.0';

final currentCLISources = {
HostPlatform.darwinUniversal: CLISource(

This comment was marked as outdated.

Comment thread
sentry[bot] marked this conversation as resolved.
Comment thread
sentry[bot] marked this conversation as resolved.
'sentry-cli-Darwin-universal',
_version,
'728d5a8c48d3e94d0a3e644431dcaad19c28b126a00eb37930e67bd146905d96',
'6aa4a42c8cf8591fe5e24cb62370dcfa40d84973bbb0f4725138eb47bb986e32',
),
HostPlatform.linuxAarch64: CLISource(
'sentry-cli-Linux-aarch64',
_version,
'79e60095ab461eac70c23ce750499bff5c6bffb95d364ccf38d3259557403987',
'987ab96a45610f00659a0ee633e64343495312e8c39250242dab12aa296240a2',
),
HostPlatform.linuxArmv7: CLISource(
'sentry-cli-Linux-armv7',
_version,
'a935540e64dc0b73e169a39034975ae326862b517739dc3e6adc7f9d0b47a657',
'98c6008651dda9ce2a8cec7fe635a3f00a563f49faf36b62afccc6af106befb0',
),
HostPlatform.linux64bit: CLISource(
'sentry-cli-Linux-x86_64',
_version,
'36b689311b399d9332950d84f4299aee682d2d290a770a77372b30a74f7e7add',
'e2bff5d8b546f3fb72c616da656ecb347c7c144f36a5294b0749dcc2001f68d5',
),
HostPlatform.windows32bit: CLISource(
'sentry-cli-Windows-i686.exe',
_version,
'81de70befaa00762703d1e911a20659161dec341ebe079f65132bed2f9e1e4be',
'5ad9cf27de932e7a519cbbf1d4f73d28151e8c3da6119bc9e66659dad3558bcc',
),
HostPlatform.windows64bit: CLISource(
'sentry-cli-Windows-x86_64.exe',
_version,
'99c1bf7a3d18df2b62ee5052f7e8f5d1e065e218442cdf0cfa2ede0b9cf7b938',
'8a617dff234dcda4ce600cef3b14874454dd907f63395a9c470c5a7120c867f6',
),
};
Comment thread
sentry[bot] marked this conversation as resolved.
Comment on lines 30 to 40

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: If the Sentry CLI download fails its checksum verification, the code logs an error but proceeds to use the corrupted binary because _download() doesn't throw an exception.
Severity: HIGH

Suggested Fix

The _download() function in setup.dart should throw an exception if the checksum verification fails after downloading the file. This will prevent the download() function from returning the path to a corrupted binary and will allow the error to be properly handled by the caller, for example, by propagating the exception up to _findAndSetCliPath()'s try-catch block.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: lib/src/cli/_sources.dart#L4-L40

Potential issue: The `CLISetup.download()` function calls `_download()` to fetch the
Sentry CLI binary. If the subsequent SHA256 checksum verification fails inside
`_download()`, the function only logs an error and does not throw an exception. Control
then returns to `CLISetup.download()`, which unconditionally returns the path to the
downloaded file. As a result, a corrupted or incorrect binary can be marked as
executable and used by the application, leading to unpredictable behavior or failures
when trying to execute the CLI.