Skip to content

fix(sourcebundle): resolve percent-encoded source paths - #1111

Open
Flpvoigt wants to merge 1 commit into
getsentry:masterfrom
Flpvoigt:flpvoigt/fix/percent-encoded-source-paths
Open

Flpvoigt wants to merge 1 commit into
getsentry:masterfrom
Flpvoigt:flpvoigt/fix/percent-encoded-source-paths

Conversation

@Flpvoigt

Copy link
Copy Markdown

Summary

  • fall back to a percent-decoded filesystem path when the path recorded in debug information cannot be opened directly
  • preserve the original encoded path in the source bundle manifest so symbolication keeps matching frames
  • add a regression test for a Dart source inside a directory containing whitespace

Fixes getsentry/sentry-dart-plugin#377

Testing

  • git diff --check
  • Not run locally: Rust/Cargo is not installed on this machine; the regression test is included for CI.

@Flpvoigt
Flpvoigt marked this pull request as ready for review October 26, 2026 17:21
@Flpvoigt
Flpvoigt requested a review from a team as a code owner October 26, 2026 17:21

@jjbayer jjbayer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code looks OK to me, and percent_encoding was already in our dependency tree (verified with cargo tree).

I would also push to fix this at the source though. It seems like the dart SDK strips file:// but does not decode the URL: https://github.com/dart-lang/sdk/blob/main/runtime/vm/debug_info.cc#L35 cc @buenaflor

return Some(BufReader::new(file));
}

let decoded = percent_decode_str(path).decode_utf8().ok()?;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Might be worth a code comment why we do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Source context stops working when project is in a folder with a whitespace in the name

2 participants