Summary
OctocrabAppClient is used across async tasks for installation-token acquisition without documented concurrency guarantees or concurrent-scenario tests.
Motivation
The PR introduces async token acquisition code that may be shared across concurrent tasks. Without documented Send + Sync guarantees and concurrent test coverage, there is a risk of subtle data races or incorrect assumptions by callers.
Proposed change
- Add a doc comment to
OctocrabAppClient in src/github/installation_token.rs (or src/github/mod.rs) explaining its concurrency model and confirming Send + Sync safety.
- Add unit tests using
tokio::spawn to exercise concurrent calls to acquire_installation_token on a shared OctocrabAppClient.
- Add a BDD scenario in
tests/features/github_installation_token.feature (and corresponding step definitions) for concurrent token requests and cancellation mid-acquisition.
Acceptance criteria
OctocrabAppClient carries a doc comment explaining its concurrency model.
- At least one unit test exercises concurrent token acquisition via
tokio::spawn.
- At least one BDD scenario covers concurrent or cancelled acquisition.
make check-fmt, make lint, and make test all pass.
Background
Identified during review of PR #77 (requested by @leynos).
Summary
OctocrabAppClientis used across async tasks for installation-token acquisition without documented concurrency guarantees or concurrent-scenario tests.Motivation
The PR introduces async token acquisition code that may be shared across concurrent tasks. Without documented
Send + Syncguarantees and concurrent test coverage, there is a risk of subtle data races or incorrect assumptions by callers.Proposed change
OctocrabAppClientinsrc/github/installation_token.rs(orsrc/github/mod.rs) explaining its concurrency model and confirmingSend + Syncsafety.tokio::spawnto exercise concurrent calls toacquire_installation_tokenon a sharedOctocrabAppClient.tests/features/github_installation_token.feature(and corresponding step definitions) for concurrent token requests and cancellation mid-acquisition.Acceptance criteria
OctocrabAppClientcarries a doc comment explaining its concurrency model.tokio::spawn.make check-fmt,make lint, andmake testall pass.Background
Identified during review of PR #77 (requested by @leynos).