Skip to content

feat: allow fetching event_id from last crash#1711

Open
jpnurmi wants to merge 3 commits into
masterfrom
jpnurmi/feat/last-crash
Open

feat: allow fetching event_id from last crash#1711
jpnurmi wants to merge 3 commits into
masterfrom
jpnurmi/feat/last-crash

Conversation

@jpnurmi
Copy link
Copy Markdown
Collaborator

@jpnurmi jpnurmi commented May 11, 2026

Expose sentry_get_last_crash so callers can inspect the previous crash timestamp and event ID after initialization.

sentry_last_crash_t crash;
if (sentry_get_last_crash(&crash, sizeof(&crash))) {
    char event_id[37];
    sentry_uuid_as_string(&crash.event_id, event_id);
    fprintf(stderr, "event_id: %s\n", event_id); // "event_id: 006be96a-0100-0000-68a3-320701000000"
    fprintf(stderr, "timestamp: %llu\n", crash.timestamp); // "timestamp: 1778520001725508"
}

The crash event ID is persisted in the same crash marker file next to the existing timestamp, while keeping the old timestamp-only marker format readable.

Close: #1447

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 11, 2026

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

Generated by 🚫 dangerJS against 94ddc4d

jpnurmi and others added 2 commits May 11, 2026 19:05
Expose `sentry_get_last_crash` so callers can inspect the previous
crash timestamp and event id after initialization.

Persist the crash event id next to the existing crash marker timestamp
while keeping the old timestamp-only marker format readable.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
@jpnurmi jpnurmi force-pushed the jpnurmi/feat/last-crash branch from 667cc64 to 8456f60 Compare May 11, 2026 17:05
Use 0 to request parsing the full null-terminated ISO8601 string. This keeps
call sites clean and avoids MSVC signed/unsigned conversion warnings.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
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.

Allow fetching event_id from last crash

1 participant