Skip to content

feat(client): Add a global refresh() to the Rust client - #202

Merged
joshuarli merged 1 commit into
mainfrom
feat/rust-global-refresh
Oct 16, 2026
Merged

joshuarli merged 1 commit into
mainfrom
feat/rust-global-refresh

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

#156 added manual refresh and with_refresh_threshold(None). In Rust, though, refresh() only exists as an Options method. The global store that init() and Options::builder()...init() create is a private OnceLock, so callers can't reach it. A Rust service that runs .with_refresh_threshold(None).init() therefore never reloads its values for the life of the process, while options() and features() keep serving the first snapshot.

Python doesn't have this gap. sentry_options.refresh() already refreshes the Python global. objectstore isn't affected either: it calls .build() and refreshes its own instance (getsentry/objectstore#549).

This PR adds sentry_options::refresh() -> Result<bool>, which refreshes the global store. It mirrors the Python function and returns NotInitialized when called before init(). The new test is in its own integration test binary, because it sets the process-wide store. Without the fix, that test does not compile.

The docs in setup.md and architecture.md now name sentry_options::refresh() for the global store. They overlap with the docs refresh in #201, which currently says the global store has no refresh(). Whichever PR merges second will need a small rebase.

Open question for review: should the Rust init() docs or the builder docs warn that with_refresh_threshold(None) needs a refresh driver? Today only the prose docs say so.

via @joshuarli.

--

View Junior Session [Sentry]

@joshuarli
joshuarli marked this pull request as ready for review October 16, 2026 22:42
Co-Authored-By: Joshua Li <14209781+joshuarli@users.noreply.github.com>

Co-Authored-By: Joshua Li <14209781+joshuarli@users.noreply.github.com>
@sentry-junior
sentry-junior Bot force-pushed the feat/rust-global-refresh branch from 98dd094 to 09d2179 Compare October 16, 2026 22:44
@joshuarli
joshuarli merged commit 7f475f7 into main Oct 16, 2026
27 checks passed
@joshuarli
joshuarli deleted the feat/rust-global-refresh branch October 16, 2026 22:49
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