prebid / prebid-mobile-android

Prebid Mobile SDK for Android applications
Apache License 2.0
57 stars 82 forks source link

Incorrect fetch demand result when internet connection is not available #668

Closed linean closed 3 months ago

linean commented 1 year ago

Describe the bug I have noticed unexpected SDK behavior when I disconnect the device from the network when Prebid ad is auto-refreshing. MediationBannerAdUnit.fetchDemand returns FetchDemandResult.SERVER_ERROR and I think the correct one should be either NETWORK_ERROR or TIMEOUT.

I've checked implementation details and FetchDemandResult is parsed from the error message which in my case is:

SDK internal error: Invalid bid response: Initialization failed: No internet connection detected

I propose we change FetchDemandResult.parseErrorMessage to check if the message contains No internet connection detected and return NETWORK_ERROR.

To Reproduce Steps to reproduce the behavior:

  1. Show Prebid banner with auto refresh enabled
  2. Disable network connection
  3. Observe FetchDemandResult from `MediationBannerAdUnit.fetchDemand
  4. You get FetchDemandResult.SERVER_ERROR suggesting there is some issue with the server

Expected behavior SDK should return NETWORK_ERROR because the network is not available.

Smartphone

jsligh commented 4 months ago

@linean is this still an issue?

linean commented 4 months ago

I don't use Prebid anymore and unfortunately I can't tell. Repro steps are pretty simple, you should be able to reproduce it on your end.