-
Notifications
You must be signed in to change notification settings - Fork 93
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
Make Parsing Methods Type Safe #1040
base: master
Are you sure you want to change the base?
Make Parsing Methods Type Safe #1040
Conversation
Co-authored-by: David Robles <[email protected]>
…PBMORTBBidExt.m Co-authored-by: David Robles <[email protected]>
…PBMORTBBidExtPrebid.m Co-authored-by: David Robles <[email protected]>
…PBMORTBBidResponseExtPrebid.m Co-authored-by: David Robles <[email protected]>
I've revisited everything related to So, the current implementation looks like a bug. I don't remember why we decided to use an array; maybe it was because of a lack of understanding of the design. Likely, I see that the current utilization of the So, I'd ask you to reimplement the patch by removing the support of the array and relying only on the object. If to talk about the current functionality, you can change it to support the following config:
Or you can ping me, and I'll do it on your branch. We shouldn't break the current behavior since the feature has not been released. However, it is important to log a respective error message if the Please let me know what you think about this approach and if you have the bandwidth to implement it. Will you be able to provide the same fixes for Android? |
Hi @YuriyVelichkoPI, This is also present in The issue occurred when the response included the If this is indeed a bug, we may need another PR to address it more formally as a bug fix. This PR, however, serves as a patch to address the current behavior. |
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.
LGTM
@ankit-thanekar007 is this issue present on Android? |
Thanks @YuriyVelichkoPI ! |
PrebidSDK Expects
Passthrough
as an Array on auction response. But it's possible for it to come in as a dictionary from Prebid Server.Consider this as an example
Here
jsonDictionary[@"passthrough"];
is coming in as a dictionary.When this line executes
NSArray<PBMJsonDictionary*> * const passthroughDics = jsonDictionary[@"passthrough"];
it sets passthroughDics as a
NSDictionary
Due to which
nextDic
infor(PBMJsonDictionary *nextDic in passthroughDics) {
is set asNSString
The next line in PrebidSDK is
PBMORTBExtPrebidPassthrough * const nextPassthrough = [[PBMORTBExtPrebidPassthrough alloc] initWithJsonDictionary:nextDic];
which calls init for
PBMORTBExtPrebidPassthrough
where it executes this line_type = jsonDictionary[@"type"];
This line tries to subscript
type
inside aNSString
which leads to this crash-[__NSCFString objectForKeyedSubscript:]: unrecognized selector sent to instance 0x300dad3b0
Approach --> We make sure to check for the expected class before accessing or initializing the objects.