Commit 3ddfb22
authored
fix(resolution): prevent duplicate org in trace ID resolution (#1289)
The `looksLikeSlug` function in `src/lib/hex-id-recovery.ts` was
incorrectly returning `true` for full target paths (e.g.,
`org/project/id`) because it only checked for alphanumeric characters
and dashes, not the presence of slashes.
This caused `buildSlugHint` to prepend the organization slug to an input
that already contained it, resulting in an invalid trace ID with a
duplicated organization segment (e.g., `org/org/project/id`). This
malformed ID then led to a `ResolutionError`.
This fix adds an early return to `looksLikeSlug` if the input string
contains a `/` character. This ensures that full paths are correctly
identified as not being bare slugs, preventing the erroneous prepending
of the organization slug and resolving the `ResolutionError`.
Fixes
[CLI-1EF](https://sentry.sentry.io/issues/7437391088/?seerDrawer=true)
<sub>Comment `@sentry <feedback>` on this PR to have Autofix iterate on
the changes.</sub>
Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>1 parent bb7422a commit 3ddfb22
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
328 | 331 | | |
329 | 332 | | |
330 | 333 | | |
| |||
0 commit comments