Hi
I can’t reproduce while in debug mode (randomly happens outside the debugger).
Attached is a txt file with a log of successful return (I see some errors but not sure how to cancel them).
Thanks,
Best answer by Andy
View originalHi
I can’t reproduce while in debug mode (randomly happens outside the debugger).
Attached is a txt file with a log of successful return (I see some errors but not sure how to cancel them).
Thanks,
Best answer by Andy
View originalYeah, it would be easier if this were widespread, but unfortunately we haven’t had anyone else report something of this severity.
Could be conflicting extensions, could be a race condition or something off about your integration with us.
Have you shared code samples with us? That’s why I suggested a little pairing session. There might be something innocuous that one of our engineers could figure out. We don’t generally offer this, but in this case we’ve pretty much exhausted other investigation methods.
I do appreciate the generous offer, I have one file that has all your API, so your world is contained. Let us do that, I am ready…
I am attaching a legitimate error I hope from one user, the user didn’t complain but I always get an attachment with the latest error and I thought to share it with you guys.
I am attaching a legitimate error I hope from one user, the user didn’t complain but I always get an attachment with the latest error and I thought to share it with you guys.
That’s perfect, I think
Before that, just a question: are you using any other SDK / plugin in your app, or otherwise do you have any date extensions in your code?
I want to set up a testing up with as similar a setup as you have as possible to see if I can reproduce locally, which would be immensely helpful
I am using swift manager to install Hero, Firebase, RevenueCat. I can share with you the date extension, but I don’t think this is the reason because the issue happens to all users, me included and I am in USA region.
please feel free to set up the love coding session and I can also send you my date extensions if you like.
After taking a look at our code, we noticed we are using the Datadog SDK, which has a similar extension on ISO8601Formatter signature as the RevenueCat SDK (both of them have the class conform to a protocol of the same name) (https://github.com/DataDog/dd-sdk-ios/blob/9cdb8fe7615949554e8a6af2ddbe2857050fed35/Sources/Datadog/Core/Utils/DateFormatting.swift)
Do you think this could cause any issues?
I have no way to reproduce, it is pure random. What I can do is grab this branch and make a new App Store binary and see if users complain. Btw, beta 8 reduced the issue by a lot but it still happens.
what do you think? Should I grab this branch and make a new App Store release?
Oh wow! Yeah, maybe that could do it. We recently rewrote our iso8601DateFormatter to use the newer `ISO8601DateFormatter`, but haven’t released a beta with it include: https://github.com/RevenueCat/purchases-ios/blob/main/Purchases/FoundationExtensions/DateFormatter%2BExtensions.swift
We’re still finishing up the last bit of StoreKit2 additions and then we’ll release another Beta. Are you able to test out this theory building from `main`?
Awesome! I’ll DM you to coordinate the exact date / time.
Also, do you happen to know the OS version in use by the folks who’re still facing the issue? I think the date formatter we’re using might have some issues with iOS 11.0-11.2
Ooof, this new error is actually on Apple’s server. They do some weird stuff with errors that makes it difficult to fully understand what the problem is sometimes, but we have a thread open on it and are going to work on a workaround, you can follow along: https://github.com/RevenueCat/purchases-ios/issues/392#issuecomment-804996692
I was able to chase down the exact response that was sent when your customer encountered:
RevenueCat LastError: Error Domain=RevenueCat.ErrorCode Code=12 "Received malformed response from the backend." UserInfo={generated_by=<snip> getSubscriberData(appUserID:completion:), NSUnderlyingError=0x2823f5f50 {Error Domain=RevenueCat.UnexpectedBackendResponseSubErrorCode Code=8 "(null)" UserInfo={NSUnderlyingError=0x280c84c80 {Error Domain=RevenueCat.CustomerInfoError Code=1 "(null)"}
The json is ok and I can manually instantiate the objects with the exact response. I met with
“subscriberData["first_seen"]” is empty, or the date format is incorrect.
OR:
“subscriberData["original_app_user_id"]” is nil.
Both of these conditions were ok in the response!
So that leaves us with some questions: what other sdks do you current use? Do you have any of your own Date extensions that you’re using? The thought is that maybe you’re using an SDK that could:
1) swizzle some of the foundation date parsing stuff (we’ve seen it)
2) have the same named Date extension so runtime resolution of the extension is non-determinate.
We really appreciate you tracking this stuff down with us. At this point, I’ve added yet more error handling to a new pr, but I think something outside our control is going on since the exact json responses that are causing issues for you are not causing issues in my testing. If I could repro this, it would be so much easier 😔
I didn’t even realize that change was not in beta-7! So ignore my previous post. Because it turns out the rewrite wasn’t the issue, it was actually a solution!
The original issue is resolved by using the recent change to use the `ISO8601DateFormatter`. https://github.com/RevenueCat/purchases-ios/issues/1096#issuecomment-997470529
It seems the original `iso8601dateformatter` code had subtle buggy issues for users with unconventional calendar or date/time settings for non-US locales. After we used a version of the SDK with the rewritten DateFormatter, our issues were resolved for our users.
Anyway, I am eagerly awaiting any fix to test.
We’ll get the docs updated, hopefully we’ll save others from running into the same thing.
Thanks so much for your patience and help in figuring out what was going on!
Don’t hesitate to get in touch again if you need any further assistance!
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.