Repository navigation
Bid requests are now queued inside the library, so an app no longer has to write its own scheduler around the Android APS SDK, which serves bid requests one at a time.
Added
loadAd(options)takes a priority and an abort signal.The library never hands the SDK more requests than it actually serves at once (1 on Android, 3 once widened withconst controller = new AbortController(); const kvs = await loader.loadAd({ priority: 0, signal: controller.signal });
bidRequestConcurrency, unbounded on iOS). Requests above that wait in a JS queue, ordered bypriority(lowest first, ties keep arrival order). While a request is still queued,controller.abort()drops it before it ever reaches Amazon. Once emitted, the SDK cannot cancel it: the abort is then ignored and the caller is responsible for discarding the answer.loadAd()with no argument behaves exactly as before.AdLoader.getQueueStats()reports the queue state for debug screens: cap in force, no-response delay, in flight, queued, emitted, aborted before emit, unanswered, max queue depth.AdLoader.NO_RESPONSE_MS, the floor of the no-response delay.getBidRequestExecutorStatus()also returnsbidTimeoutMs, the SDK bid timeout reported by Android, which Amazon can change server-side.
Fixed
loadAdalways settles. The Android SDK can swallow an exception before its HTTP call and never call back, leaving the promise pending for the life of the process. It now rejects with anAdErrorof codeno_response, and frees the queue slot. The delay is at least 8 s, above the SDK network budget (1 s connect plus 5 s read), and followsbidTimeoutMs + 3 swhen Android reports a higher value.- Native request map leak. Every one-shot request stayed in a native map for the life of the process, one per placement and per auction cycle. It is now removed on its first callback, with an identity check so a newer request reusing the same id is never dropped. Both platforms lock their map.
stopAutoRefresh()also drops a request still waiting in the queue.
Behaviour changes
loadAdcan now reject where it previously stayed pending forever:abortedwhen the caller aborts a queued request,no_responsewhen the native side never answers. A call site without a.catchwill surface an unhandled rejection where it used to hang silently.- Automatic SDK refreshes do not go through the queue, only explicit
loadAdcalls do.
Internal
- Android JVM unit tests now run in CI, so the guard test that checks the SDK private fields still exist really blocks an SDK bump that renames them.
Validated at runtime before release: queueing, priority order, abort before emit under simulated latency, no_response at 8 s with a muted native callback and recovery of the queued request, native map cleanup, on a Pixel emulator and a Galaxy S22 with real bids, plus an iOS simulator build.
Full Changelog: v2.5.0...v2.6.0