Repository navigation
sdk: avoid deprecated AtomicUsize::fetch_update - #1496
Merged
yukibtc merged 1 commit intoOct 19, 2026
Merged
Conversation
Rust 1.99 deprecates `fetch_update` in favor of `try_update`, so the "Check stable" CI job, which builds with `-D warnings`, fails on `PendingReqCounter::decrement`. `try_update` is above the 1.85 MSRV, so write out the compare-and-swap loop that `fetch_update` performs instead. The decrement still saturates at zero. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
3 tasks done
Contributor
Author
|
@yukibtc The loop is only needed because of the MSRV. |
yukibtc
approved these changes
Oct 19, 2026
agent-p1p
added a commit
to erskingardner/rust-nostr
that referenced
this pull request
Oct 19, 2026
Catch up with the `AtomicUsize::fetch_update` deprecation fix (nostrdevkit#1496), which unbreaks the "Check stable" CI job, and the nostr-connect API rework (nostrdevkit#1494). The merge has no conflicts, and the fork's delta against upstream is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The "Check stable" CI job fails on
master(de3031a) and on the open PRs #1494 and #1495. It builds with-D warnings, and Rust 1.99 deprecatesAtomicUsize::fetch_update(renamed totry_update), whichPendingReqCounter::decrementuses. Nobody using the crate is affected, but the failing job hides real failures on new PRs.Fix
Replace the
fetch_updatecall with the compare-and-swap loop it performs internally.try_updateis newer than the 1.85 MSRV, so it can't be used yet, and writing out the loop avoids suppressing the lint. The decrement still saturates at zero.Notes to the reviewers
CARGO_BUILD_RUSTFLAGS="-D warnings" cargo +1.99.0 build --workspace --all-targetsandcargo +1.99.0 clippy --all-targets -- -D warningsboth pass. Onmaster, the build fails with the same error as CI.pending_req_counter_does_not_underflowandpending_req_counter_tracks_requests_until_all_are_droppedtests cover the behaviour.just precommitpasses.Checklist
CHANGELOG.md(if applicable)🤖 Generated with Claude Code