Skip to content

Release 2.6.0

Latest

Choose a tag to compare

@JeromeBonfort JeromeBonfort released this 22 Sep 12:36
0cee567

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.
    const controller = new AbortController();
    const kvs = await loader.loadAd({ priority: 0, signal: controller.signal });
    The library never hands the SDK more requests than it actually serves at once (1 on Android, 3 once widened with bidRequestConcurrency, unbounded on iOS). Requests above that wait in a JS queue, ordered by priority (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 returns bidTimeoutMs, the SDK bid timeout reported by Android, which Amazon can change server-side.

Fixed

  • loadAd always 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 an AdError of code no_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 follows bidTimeoutMs + 3 s when 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

  • loadAd can now reject where it previously stayed pending forever: aborted when the caller aborts a queued request, no_response when the native side never answers. A call site without a .catch will surface an unhandled rejection where it used to hang silently.
  • Automatic SDK refreshes do not go through the queue, only explicit loadAd calls 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