Skip to content
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

Enabling "Enforce User Identity Validation" cause ChatwootClientException in SDK #39

Open
Abhishek-Vijay opened this issue Mar 10, 2023 · 0 comments

Comments

@Abhishek-Vijay
Copy link

Hi,
I have been trying to enforce user identity validation in chatwoot SDK but getting this exception -

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Instance of 'ChatwootClientException'
E/flutter (13424): #0 ChatwootClientAuthServiceImpl.createNewContact (package:chatwoot_client_sdk/data/remote/service/chatwoot_client_auth_service.dart:52:7)
E/flutter (13424):
E/flutter (13424): #1 ChatwootClientApiInterceptor.onRequest. (package:chatwoot_client_sdk/data/remote/service/chatwoot_client_api_interceptor.dart:37:19)
E/flutter (13424):
E/flutter (13424): #2 BasicLock.synchronized (package:synchronized/src/basic_lock.dart:33:16)
E/flutter (13424):
E/flutter (13424): #3 ChatwootClientApiInterceptor.onRequest (package:chatwoot_client_sdk/data/remote/service/chatwoot_client_api_interceptor.dart:29:5)
E/flutter (13424):

When I dig deeper in the exception, I realized that this exception is caused when createNewContact function is trying to Create Contact using createContactAPI in chatwoot_client_auth_service.dart file. the Exception is -
DioError [DioErrorType.response]: Http status error [500]

this exception came because createConatctAPI expects "identifier_hash" attribute but SDK pass "identifierHash" attribute instead.
since the ChatwootUser function is written this way -
ChatwootUser(
{this.identifier,
this.identifierHash,
this.name,
this.email,
this.avatarUrl,
this.customAttributes});

and client ContactsAPI expects payload in this format -
{
"identifier": "string",
"identifier_hash": "string",
"email": "string",
"name": "string",
"phone_number": "string",
"avatar_url": "string",
"custom_attributes": { }
}

What should I do in this case.?
I am attaching postman screenshots also to describe the issue clearly

Error Image
image

Success Event Image
image

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

No branches or pull requests

1 participant