fix: contact is not available for inaccessible sender (#5509)

Fixes: #5508

We can not read contact information because of this error, as the messages echo when the sender sends messages to contacts. We don't have the user's consent until and unless they send messages to us.

So after this result, information about the contact is empty, and we are trying to create a contact inbox for the same, and the error appears.

type: OAuthException, code: 230, message: (#230) User consent is required to access user profile, x-fb-trace-id: AaitxF/whwY [HTTP 403] (Koala::Facebook::ClientError)
This commit is contained in:
Tejaswini Chile
2022-09-29 01:20:23 +05:30
committed by GitHub
parent 83eee7df91
commit fcb9a9ab0c
3 changed files with 57 additions and 6 deletions

View File

@@ -147,4 +147,39 @@ FactoryBot.define do
end
initialize_with { attributes }
end
factory :instagram_story_mention_event_with_echo, class: Hash do
entry do
[
{
'id': 'instagram-message-id-1234',
'time': '2021-09-08T06:34:04+0000',
'messaging': [
{
'sender': {
'id': 'Sender-id-1'
},
'recipient': {
'id': 'chatwoot-app-user-id-1'
},
'timestamp': '2021-09-08T06:34:04+0000',
'message': {
'mid': 'message-id-1',
'attachments': [
{
'type': 'story_mention',
'payload': {
'url': 'https://www.example.com/test.jpeg'
}
}
],
'is_echo': true
}
}
]
}
]
end
initialize_with { attributes }
end
end