[MoPubInterstitialView] Fail to transition mCurrentInterstitialState may cause impression data discrepancy


#1

What I want to do

I want to make sure if MoPub Failover tag can work well, so i put the failover tag as my HTML creative code and expect Mopub Sample App would show Interstitial: failed to load toast every time.


In the demo page if i click LOAD AD button twice, the second time it would pop a toast Interstitial loaded and enable SHOW AD button. And if i click the SHOW AD button, Mopub system would plus impression number. It means Mopub Failover tag doesn’t work.

What i found

In https://github.com/mopub/mopub-android-sdk/blob/master/mopub-sdk/mopub-sdk-interstitial/src/main/java/com/mopub/mobileads/MoPubInterstitial.java#L505, Mopub Failover tag would trigger this function

...
@Override
protected void adFailed(MoPubErrorCode errorCode) {
    attemptStateTransition(IDLE);
    if (mInterstitialAdListener != null) {
        mInterstitialAdListener.onInterstitialFailed(MoPubInterstitial.this, errorCode);
    }
}
...

In this function mCurrentInterstitialState didn’t be change to be IDLE since we don’t make force parameter as true. And It may cause the problem given above.

Question

My question is why SDK didn’t force to transition IDLE status while adFailed is triggered.


#2

@zxcvbnye Thanks for raising this! We’re investigating and will provide an update here soon.