-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Paywalls V2] Convert Codable structs to classes #4665
Conversation
1 build decreased size
Paywalls 1.0 (1)
|
Item | Install Size Change |
---|---|
RevenueCat.OfferingsFactory.OfferingsFactory | ⬇️ -108.9 kB |
Code Signature | ⬇️ -96.9 kB |
RevenueCatUI.IconComponentViewModel.IconComponentViewModel | ⬇️ -70.2 kB |
RevenueCatUI.ImageComponentViewModel.ImageComponentViewModel | ⬇️ -69.3 kB |
DYLD.String Table | ⬆️ 53.2 kB |
🛸 Powered by Emerge Tools
Comment trigger: Size diff threshold of 100.00kB exceeded
let visible = other?.visible ?? base?.visible | ||
let baseUrl = other?.baseUrl ?? base?.baseUrl | ||
let iconName = other?.iconName ?? base?.iconName | ||
let formats = other?.formats ?? base?.formats | ||
let size = other?.size ?? base?.size | ||
let padding = other?.padding ?? base?.padding | ||
let margin = other?.margin ?? base?.margin | ||
let color = other?.color ?? base?.color | ||
let iconBackground = other?.iconBackground ?? base?.iconBackground |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to do this because Swift compiler was timing out 🤷♂️
39f6e72
to
0e4fd29
Compare
Motivation
We were getting random-ish
EXC_BAD_ACCESS
after the merge of the badge PR. It took some debuggin and it turned out..When decoding 5-ish paywall v2 in an
OfferingsResponse
, thestruct
structure while in the encoder would just fail.Note that this is in the ENCODER... and not the DECODER. So this was happening when we decode string response to Swift object and then encode back for storage.
Description
After some debugging and experimentation with Mark, it was our conclusion that our OfferingsResponse struct with the Paywalls V2 struct were causing some sort of struct structure that was WAY too big causing some sort of buffer overflows or something.
We experiment with converting one struct to a class and it made the issue go away. So we continue this in the PR to convert all Paywalls V2 components that are codable from structs (value type) to classes (reference type) to mitigate this issue.