Skip to content

Conversation

@limbonaut
Copy link
Collaborator

@limbonaut limbonaut commented Sep 2, 2025

📜 Description

This PR adds support for vars attribute to the SentryStackFrame class. While it existed previously, it wasn’t serialized and had a String->String mapping type.

💡 Motivation and Context

These changes are necessary for the Godot SDK to capture script variables on Android. For GDScript errors, we construct a stack trace and attach variables for each frame. There is a similar setup with Sentry Native and Cocoa SDKs.

💚 How did you test it?

I've added serialization tests.

📝 Checklist

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

The vars field previously existed as a property but was never
serialized. We use frame.vars to report Godot GDScript trace variables
in constructed frames.
@github-actions
Copy link
Contributor

github-actions bot commented Sep 2, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against fdb8f10

@github-actions
Copy link
Contributor

github-actions bot commented Sep 2, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 369.86 ms 396.39 ms 26.53 ms
Size 1.58 MiB 2.10 MiB 533.46 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
ee747ae 382.73 ms 435.41 ms 52.68 ms
ee747ae 415.92 ms 470.15 ms 54.23 ms
ee747ae 400.46 ms 423.61 ms 23.15 ms
ee747ae 554.98 ms 611.50 ms 56.52 ms
ee747ae 358.21 ms 389.41 ms 31.20 ms
3699cd5 423.60 ms 495.52 ms 71.92 ms
85d7417 347.21 ms 394.35 ms 47.15 ms
7314dbe 437.83 ms 505.64 ms 67.81 ms
ee747ae 357.79 ms 421.84 ms 64.05 ms
ee747ae 374.71 ms 455.18 ms 80.47 ms

App size

Revision Plain With Sentry Diff
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
3699cd5 1.58 MiB 2.10 MiB 533.45 KiB
85d7417 1.58 MiB 2.10 MiB 533.44 KiB
7314dbe 1.58 MiB 2.10 MiB 533.45 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB

Previous results on branch: feat/frame-vars

Startup times

Revision Plain With Sentry Diff
5355eb0 361.81 ms 412.04 ms 50.23 ms
712d637 420.38 ms 481.23 ms 60.85 ms
0da200a 384.89 ms 414.40 ms 29.51 ms

App size

Revision Plain With Sentry Diff
5355eb0 1.58 MiB 2.10 MiB 533.47 KiB
712d637 1.58 MiB 2.10 MiB 533.46 KiB
0da200a 1.58 MiB 2.10 MiB 533.46 KiB

@limbonaut limbonaut changed the title feat: Frame vars feat: Add support for vars attribute in SentryFrame Sep 2, 2025
@limbonaut limbonaut changed the title feat: Add support for vars attribute in SentryFrame feat: Add support for vars attribute in SentryStackFrame Sep 2, 2025
@limbonaut limbonaut marked this pull request as ready for review September 2, 2025 11:04
Copy link
Member

@lcian lcian left a comment

Choose a reason for hiding this comment

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

Changes look good to me, however this is technically a breaking change as we're changing the return/param types on a public class.
I'll let someone else from the team give their opinion on whether this is a reasonable change or if we should look for a workaround so that this is not breaking.

@limbonaut
Copy link
Collaborator Author

Technically, it would be a breaking change if it were in use and working as expected. Seeing that it's actually not serialized, I strongly suspect that it's not being used anywhere, or otherwise you'd have it at least reported. Not sure it's worth the trouble engineering a workaround for API contract that didn't work in the first place.

Copy link
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

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

LGTM, let's just add a note to the changelog, but the impact should be minimal-to-none, so we should be good here.

Co-authored-by: Roman Zavarnitsyn <rom4ek93@gmail.com>
@romtsn romtsn mentioned this pull request Sep 4, 2025
@limbonaut limbonaut merged commit 4051bdc into main Sep 4, 2025
43 of 44 checks passed
@limbonaut limbonaut deleted the feat/frame-vars branch September 4, 2025 14:37
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.

4 participants