Skip to content

Commit a68219d

Browse files
author
Francesco Vigliaturo
committed
Preserve the list of original frames and update them with the result
from symbolicator Uses _merge_image instead of blindly replacing them with the response from symbolicator. In case we have other images than native and sourcemaps, this will also preserve them.
1 parent 8f3801e commit a68219d

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/sentry/profiles/task.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from sentry import quotas
1414
from sentry.constants import DataCategory
1515
from sentry.lang.javascript.processing import _handles_frame as is_valid_javascript_frame
16+
from sentry.lang.native.processing import _merge_image
1617
from sentry.lang.native.symbolicator import Symbolicator, SymbolicatorTaskKind
1718
from sentry.lang.native.utils import native_images_from_data
1819
from sentry.models.debugfile import ProjectDebugFile
@@ -173,6 +174,7 @@ def _symbolicate_profile(profile: Profile, project: Project) -> bool:
173174
return True
174175

175176
platforms = get_profile_platforms(profile)
177+
original_images = profile["debug_meta"]["images"]
176178
images = dict()
177179
for platform in platforms:
178180
images[platform] = get_debug_images_for_platform(profile, platform)
@@ -195,6 +197,10 @@ def _symbolicate_profile(profile: Profile, project: Project) -> bool:
195197
platform=platform,
196198
)
197199

200+
assert len(images[platform]) == len(modules)
201+
for raw_image, complete_image in zip(images[platform], modules):
202+
_merge_image(raw_image, complete_image, None, profile)
203+
198204
if success:
199205
_process_symbolicator_results(
200206
profile=profile,
@@ -214,9 +220,7 @@ def _symbolicate_profile(profile: Profile, project: Project) -> bool:
214220
reason="profiling_failed_symbolication",
215221
)
216222
return False
217-
profile["debug_meta"]["images"] = []
218-
for imgs in images.values():
219-
profile["debug_meta"]["images"].extend(imgs)
223+
profile["debug_meta"]["images"] = original_images
220224
profile["processed_by_symbolicator"] = True
221225
return True
222226

0 commit comments

Comments
 (0)