Skip to content

[0.17] ref!: sentry_value-based attachments - #1974

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

[0.17] ref!: sentry_value-based attachments#1974
jpnurmi wants to merge 2 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.17806% with 175 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.60%. Comparing base (dec0e5e) to head (20c5112).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1974      +/-   ##
==========================================
+ Coverage   74.24%   74.60%   +0.36%     
==========================================
  Files         104      104              
  Lines       26584    26786     +202     
  Branches     4838     4860      +22     
==========================================
+ Hits        19736    19985     +249     
+ Misses       5499     5455      -44     
+ Partials     1349     1346       -3     
🚀 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
@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
Comment thread src/backends/sentry_backend_crashpad.cpp Outdated
Comment thread src/backends/sentry_backend_crashpad.cpp Outdated
Comment thread src/backends/sentry_backend_crashpad.cpp
Comment thread src/backends/sentry_backend_crashpad.cpp
@jpnurmi
jpnurmi force-pushed the jpnurmi/ref/attachments branch 2 times, most recently from 4677c4e to 4c21efb Compare August 20, 2026 16:26
@jpnurmi
jpnurmi changed the base branch from master to jpnurmi/ref/attachments-prep August 20, 2026 16:30
Comment thread src/backends/sentry_backend_native.c
Base automatically changed from jpnurmi/ref/attachments-prep to master August 25, 2026 17:13
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 d521912 to 08e8f8c Compare August 26, 2026 09:09

@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 1 potential issue.

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 08e8f8c. Configure here.

Comment thread src/backends/sentry_backend_crashpad.cpp Outdated
@jpnurmi
jpnurmi force-pushed the jpnurmi/ref/attachments branch 2 times, most recently from ef00839 to bb5f6d7 Compare August 26, 2026 09:52
Comment thread src/sentry_attachment.c Outdated
@jpnurmi
jpnurmi force-pushed the jpnurmi/ref/attachments branch from bb5f6d7 to c5b45c3 Compare August 26, 2026 10:03
@jpnurmi
jpnurmi force-pushed the jpnurmi/ref/attachments branch from c5b45c3 to 20c5112 Compare August 26, 2026 12:55
@jpnurmi jpnurmi changed the title ref!: sentry_value-based attachments [0.17] ref!: sentry_value-based attachments Aug 26, 2026
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