Skip to content

ref!: sentry_value-based attachments - #1974

Open
jpnurmi wants to merge 7 commits into
masterfrom
jpnurmi/ref/attachments
Open

ref!: sentry_value-based attachments#1974
jpnurmi wants to merge 7 commits into
masterfrom
jpnurmi/ref/attachments

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Caution

BREAKING CHANGE

Attachment APIs now use sentry_value_t and sentry_uuid_t instead of sentry_attachment_t *.

Scope data is moving to fine-grained read/write locking (#1877) to allow concurrent readers. A read-locked getter cannot safely return a borrowed sentry_attachment_t pointer because a writer may remove and free the attachment as soon as the read lock is released, crashing a potential concurrent reader.

Represent attachments and attachment collections as refcounted sentry_value_t objects. A getter can retain the value under the read lock and return an owned reference that remains valid after unlocking.

Configure attachments before insertion and freeze them once added. Use UUIDs for removal, and retain byte values while envelopes borrow their payload to avoid copying attachment data.

See also:

Resolves: #1945

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.23043% with 188 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.67%. Comparing base (38fb099) to head (92e0dd1).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1974      +/-   ##
==========================================
+ Coverage   74.31%   74.67%   +0.36%     
==========================================
  Files         104      104              
  Lines       25738    26171     +433     
  Branches     4648     4722      +74     
==========================================
+ Hits        19126    19543     +417     
+ Misses       5305     5297       -8     
- Partials     1307     1331      +24     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jpnurmi
jpnurmi force-pushed the jpnurmi/ref/attachments branch from 4ecd0c8 to 7cfebae Compare August 11, 2026 20:01
@jpnurmi
jpnurmi changed the base branch from master to jpnurmi/fix/unwinder-arm32-ip August 12, 2026 06:31
@jpnurmi
jpnurmi force-pushed the jpnurmi/ref/attachments branch from 7cfebae to ed216c7 Compare August 12, 2026 06:33
Comment thread src/sentry_core.c
Comment thread src/sentry_core.c Outdated
Comment thread src/sentry_core.c
Comment thread src/backends/sentry_backend_native.c Outdated
Base automatically changed from jpnurmi/fix/unwinder-arm32-ip to master August 13, 2026 12:47
Allow callers with borrowed path strings to obtain the final path component
without allocating a sentry_path_t. This prepares value-based attachment
properties, which expose borrowed strings.
@jpnurmi
jpnurmi force-pushed the jpnurmi/ref/attachments branch from 77576ea to 8349c66 Compare August 17, 2026 07:51
Comment thread src/sentry_attachment.c Outdated
@jpnurmi
jpnurmi force-pushed the jpnurmi/ref/attachments branch from 8349c66 to c7f80db Compare August 17, 2026 09:40
Comment thread src/sentry_core.c
@jpnurmi
jpnurmi force-pushed the jpnurmi/ref/attachments branch from c7f80db to b901758 Compare August 17, 2026 10:37
Comment thread src/backends/sentry_backend_breakpad.cpp
@jpnurmi jpnurmi changed the title [WIP] ref!: sentry_value-based attachments ref!: sentry_value-based attachments Aug 18, 2026
Use each byte attachment's existing UUID as its run-directory name in
both native and Crashpad. This gives the attachment a stable path before
scope storage freezes its metadata and lets later consumers recover the
same location without mutating the attachment.

Keep the original filename as the basename so crash uploads preserve the
user-facing attachment name.
Comment thread src/backends/sentry_backend_crashpad.cpp Outdated
Comment thread src/backends/sentry_backend_crashpad.cpp Outdated
Derive backend byte attachment paths from the attachment UUID without storing
the path in attachment metadata. Resolve the same path when native serializes
crash attachments and when Crashpad removes them.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a6dd4ac. Configure here.

Comment thread src/backends/sentry_backend_crashpad.cpp
Comment thread src/backends/sentry_backend_crashpad.cpp
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.

ref(attachments): rework to be sentry_value_t-based

1 participant