Skip to content

[Fix] Consider a network error as not successfully synced for paywall events#1900

Merged
MarkVillacampa merged 2 commits into
mainfrom
paywall-event-fix
Nov 5, 2024
Merged

[Fix] Consider a network error as not successfully synced for paywall events#1900
MarkVillacampa merged 2 commits into
mainfrom
paywall-event-fix

Conversation

@MarkVillacampa

Copy link
Copy Markdown
Member

Checklist

  • If applicable, unit tests
  • If applicable, create follow-up issues for purchases-ios and hybrids

Motivation

While investigating missing impression events, I found a possible logic issue on Android where we are considering a network error as "successfully synced" and hence deleting any pending events.

@MarkVillacampa MarkVillacampa added the pr:fix A bug fix label Nov 5, 2024
paywallEventsCallbacks.remove(paywallEventRequest.cacheKey)
}?.forEach { (_, onErrorHandler) ->
onErrorHandler(error, true)
onErrorHandler(error, false)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't think of any reason why we should consider network errors as synced yeah... Might be worth adding some tests for this but this looks good!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added tests 👍

@codecov

codecov Bot commented Nov 5, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.28%. Comparing base (84874c9) to head (b9ec5ed).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1900      +/-   ##
==========================================
+ Coverage   82.16%   82.28%   +0.11%     
==========================================
  Files         231      231              
  Lines        8048     8048              
  Branches     1132     1132              
==========================================
+ Hits         6613     6622       +9     
+ Misses        986      979       -7     
+ Partials      449      447       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MarkVillacampa MarkVillacampa merged commit 1a7f20a into main Nov 5, 2024
@MarkVillacampa MarkVillacampa deleted the paywall-event-fix branch November 5, 2024 10:05
tonidero added a commit that referenced this pull request Nov 8, 2024
**This is an automatic release.**

## RevenueCat SDK
### ✨ New Features
* Add `tenjinAnalyticsInstallationId` setter property (#1897) via Toni
Rico (@tonidero)
### 🐞 Bugfixes
* [Fix] Consider a network error as not successfully synced for paywall
events (#1900) via Mark Villacampa (@MarkVillacampa)

### 🔄 Other Changes
* [Paywalls] Synchronize paywall events on app backgrounding and after a
purchase (#1901) via Mark Villacampa (@MarkVillacampa)
* Dispatcher catches and rethrows Throwable instead of Exception to
avoid swallowing errors (#1894) via JayShortway (@JayShortway)

---------

Co-authored-by: revenuecat-ops <ops@revenuecat.com>
Co-authored-by: Toni Rico <antonio.rico.diez@revenuecat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants