Repository navigation
2.4.6: The Honest API & Riverpod Edition
This is a massive release that brings architectural honesty, a brand-new official Riverpod package, and a monumental increase in testing rigor.
🚀 New: Honest API — No Silent Failures
ThrottlerResult — Know if the operation actually ran
ConcurrentAsyncThrottler.call() now returns Future<ThrottlerResult> instead of Future<void>.
This prevents a class of silent-failure bugs where dropped operations appeared to succeed.
// ❌ Before: silent failure — showSuccessDialog() fires even if order was never submitted
await throttler.call(() async => submitOrder(orderId));
showSuccessDialog();
// ✅ After: exhaustive handling required at compile time
(await throttler.call(() async => submitOrder(orderId))).when(
onExecuted: () => showSuccessDialog(),
onDropped: () => showError('Server busy — please try again.'),
);DebounceResult — Exhaustive pattern matching
callWithResult() existed before; now DebounceResult gains when() and fluent helpers:
(await debouncer.callWithResult(() => searchApi(query)))
.whenSuccess((data) => setState(() => _results = data))
.whenCancelled(() => setState(() => _loading = false));CancellationToken support
ConcurrentAsyncThrottler.callWithToken() allows cooperative cancellation of in-flight async work.
🎉 New Official Package: flutter_debounce_throttle_riverpod
We have released a dedicated integration for Riverpod! EventLimiterController ties debounce/throttle timers to a Riverpod Ref lifecycle — zero boilerplate, auto-cleanup on provider dispose.
dependencies:
flutter_debounce_throttle_riverpod: ^1.0.0🛡️ Unprecedented Testing Rigor
- Test suite expanded massively: Jumped from ~140 tests to 570+ tests, reaching 98% coverage.
- New Test Categories: Added
PerformanceStressTest,SystemStressTest, andSecurityTestto guarantee behavior under extreme loads. - Hooks Coverage: Hooks tests expanded from 18 to 63 to ensure absolute stability.
🎨 Documentation & Demo Overhaul
- New Demo Apps: The example app has been completely rebuilt with 5+ interactive scenarios.
- Visual Documentation:
README.mdnow features a beautiful 6-grid GIF layout demonstrating (Search, Throttle, Submit, Concurrency Replace, Hooks, and Riverpod). - Recording Guide: Added
RECORDING_GUIDE.mdand automated scripts for generating documentation assets.
🔧 Bug Fixes & CI Improvements
- Async Race Conditions Resolved: Fixed lock race conditions in
AsyncThrottlerandAsyncDebouncerwhere timeout callbacks could improperly unlock state for subsequent valid executions. - Enqueue Overflow Fix:
ConcurrentAsyncThrottlerpreviously threw an unhandled exception on overflow; it now gracefully resolves withThrottlerResult.dropped(). - CI/CD Stability: Resolved persistent
melos bootstrapfailures, addeddependency_overridesfor local example resolution, and migrated to Node.js 20 compatible GitHub Actions. - Cleanup:
reset()anddispose()now correctly drain all pending completers withThrottlerResult.dropped()instead of leaving awaiting callers permanently suspended.