Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

'UserDTO' Decoding error: Expected to decode Int64 but found a string/data instead. #107

Closed
RBasiev opened this issue Apr 2, 2020 · 1 comment

Comments

@RBasiev
Copy link

RBasiev commented Apr 2, 2020

Hi!
I recently updated Drift pod to 2.4.0 version, and got the following error with UserDTO decoding (caught by breakpoint).

Function: DriftManager.75 class func registerUser
Request: URL: https://event.api.drift.com/identify
Response: {\"id\":\"404cba19856ce46a9f7b1f5ef4409215\",\"userId\":\"1000059\",\"anonymousId\":null,\"companyId\":null,\"internal\":false,\"attributes\":{\"email\":\"rus.basiev@gmail.com\"},\"context\":{},\"createdAt\":1585788857338,\"orgId\":1167954,\"signedIdentity\":null,\"isDebug\":false}"

In model I found that user's identifier is: var userId: Int64?
It makes url request, and tries to decode UserDTO from response. But as you see, there is a string 'id' in response JSON.

The result of decoding UserDTO is not used, so the next function (auth) works fine. But maybe you can fix user decoding to prevent Swift Error Breakpoint activation

@eoinoconnell
Copy link
Contributor

Thanks for that, have that resolved and should be live on Cocoapods in the next 30 mins

Appreciate the help!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants