Cloudkibo / KiboPush

0 stars 1 forks source link

Cannot read property 'type' of null #10465

Closed saniasiddiqui closed 3 years ago

saniasiddiqui commented 3 years ago

Title Cannot read property 'type' of null

Sentry StackTrace and Sentry LinkSentry Issue: KIBOPUSH-2QC

TypeError: Cannot read property 'type' of null
  File "/root/KiboChat/server/api/v1.1/chatbots/commerceChatbot.logiclayer.js", line 1486, in Object.exports.getNextMessageBlock
    if (action.type === DYNAMIC) {
  ?, in runMicrotasks

Events: 1

Users: 0

Last Seen: 5 hours ago

First Seen: 5 hours ago

Environment: production

Server_Name: KiboChat

IP:

Front End or Backend End issue? Backend

Additional Data Add any other context about the problem here.

sentry-io[bot] commented 3 years ago

Sentry issue: KIBOPUSH-2QC

AnishaChhatwani commented 3 years ago

Steps to reproduce:

  1. Go to https://www.messenger.com/t/146690295986803 and send a message other than 'hi, hello'. For Example, send 'hey there'
  2. See the error on sentry

Identify what broke the code? This was happening when a page has commerce chatbot enabled and subscriber sent anything on messenger that is not a trigger word for commerce chatbot. In that case, it was trying to access action.type but action was undefined.

Identify the commit and developer who is responsible for that change. (Issue number, pull request) Commit: https://github.com/Cloudkibo/KiboChat/commit/c1b5912ae601d84964e05441b92967993916c5f7 Pull Request: https://github.com/Cloudkibo/KiboChat/pull/836 Issue number: https://github.com/Cloudkibo/KiboPush/issues/9586

What is the way that we can ensure that this code doesn’t break again? by adding null checks

User for whom this error occurred? This happened on baqar's account for page 'Test 3'.

What is the impact of this error on user? User won't receive any response back, and this is the correct scenario. So, this error doesn't have any impact on the user.

AnishaChhatwani commented 3 years ago

@bjafri5 please test on staging

bjafri5 commented 3 years ago

Tested on staging

AnishaChhatwani commented 3 years ago

@bjafri5 please test on production

bjafri5 commented 3 years ago

Tested on production