Skip to content

feat(native): TUS upload for large attachments#1684

Merged
jpnurmi merged 3 commits intomasterfrom
jpnurmi/feat/native-tus
Apr 30, 2026
Merged

feat(native): TUS upload for large attachments#1684
jpnurmi merged 3 commits intomasterfrom
jpnurmi/feat/native-tus

Conversation

@jpnurmi
Copy link
Copy Markdown
Collaborator

@jpnurmi jpnurmi commented Apr 28, 2026

Follows up on #1545 with TUS/large-attachment support for the native daemon.

image

https://sentry-sdks.sentry.io/issues/7452013648/?project=4506178389999616

#skip-changelog (in #1545)

Comment thread src/backends/native/sentry_crash_daemon.c Outdated
@jpnurmi jpnurmi force-pushed the jpnurmi/feat/tus branch 5 times, most recently from 174dcb1 to a54f799 Compare April 29, 2026 17:34
@jpnurmi jpnurmi force-pushed the jpnurmi/feat/native-tus branch 2 times, most recently from 58dd9b3 to 6948a9a Compare April 30, 2026 10:33
Comment on lines -3013 to -3015
// Mark as done
SENTRY_DEBUG("Marking crash state as DONE");
sentry__atomic_store(&ctx->state, SENTRY_CRASH_STATE_DONE);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Moved to sentry__crash_daemon_main() after sentry__transport_shutdown() and sentry__transport_dump_queue(), to prevent DONE from being written before the daemon has either sent or dumped the crash envelope if it hit the shutdown timeout.

Comment thread src/backends/native/sentry_crash_daemon.c
@jpnurmi jpnurmi force-pushed the jpnurmi/feat/native-tus branch from 6948a9a to b45ff1b Compare April 30, 2026 13:42
Comment thread src/backends/native/sentry_crash_daemon.c
Comment thread src/backends/native/sentry_crash_daemon.c
@jpnurmi jpnurmi changed the title WIP: feat(native): TUS upload for large attachments feat(native): TUS upload for large attachments Apr 30, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 30, 2026

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

Generated by 🚫 dangerJS against 3605d1e

Copy link
Copy Markdown

@cursor cursor Bot left a comment

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.

There are 2 total unresolved issues (including 1 from previous review).

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 8a3b72c. Configure here.

Comment thread src/backends/native/sentry_crash_daemon.c Outdated
Base automatically changed from jpnurmi/feat/tus to master April 30, 2026 14:59
jpnurmi and others added 3 commits April 30, 2026 17:00
Preserve the large-attachment setting in the native crash context so the crash
daemon can handle attachment placeholders after a crash. The daemon now skips
inlining placeholder attachments, caches them as attachment-ref items, and lets
the HTTP transport resolve those refs through the TUS upload flow.

Keep the materialized crash envelope and cached attachment files available for
restart retry when shutdown cannot finish the transport work. Clean the run only
after a clean shutdown with no dumped envelopes, and mark the crash state as DONE
after crash processing has reached daemon cleanup.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: OpenAI Codex <noreply@openai.com>
Force native crash daemon run cleanup after a successful transport drain.
Large crash attachments retain the run for shutdown persistence, but a
successful send must remove it to avoid resending on the next startup.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Call the single-attachment cache helper from the native crash daemon after
the attachment has already been checked as a placeholder. This avoids
re-running the placeholder filter for a single temporary attachment.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
@jpnurmi jpnurmi force-pushed the jpnurmi/feat/native-tus branch from f58ee3e to 3605d1e Compare April 30, 2026 15:01
@jpnurmi jpnurmi merged commit 4e67694 into master Apr 30, 2026
60 checks passed
@jpnurmi jpnurmi deleted the jpnurmi/feat/native-tus branch April 30, 2026 15:34
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.

2 participants