Cloudkibo / KiboPush

0 stars 1 forks source link

(sentry) Cannot read property 'title' of undefined #10645

Closed sojharo closed 3 years ago

sojharo commented 3 years ago

Title Cannot read property 'title' of undefined (Multiple chatbot handling using one whatsapp account)

function: temporarySuperBotTestHandling()

Sentry StackTrace and Sentry Link https://sentry.io/organizations/cloudkibo/issues/2084002409/?project=292307&referrer=slack

Screenshot 2020-12-11 at 09 07 54

Events: 1

Users: 0

Last Seen: 2:00 AM Pakistan Time

First Seen: 2:00 AM Pakistan Time

Environment: Production

Server_Name: KiboChat

Page Name: Whatsapp FlockSend Number

Subscriber Name: Sojharo

User Name: Sojharo

IP: Not available

Front End or Backend End issue? Backend issue

Additional Data Sentry Logs:

 Dec 10 03:46:12 KiboChat default error {"path":"api/v1️.1/whatsAppChatbot/airlinesChatbot.logiclayer.js: getFlightSchedulesBlock","message":{},"data":{},"otherInfo":{"chatbot":{"botLinks":{"faqs":"https://kibopush.com/faqs","paymentMethod":"","returnPolicy":""},"stats":{"triggerWordsMatched":25,"newSubscribers":0},"usedBy":0,"triggers":["hi","hello"],"testSubscribers":[],"maxLevels":3,"published":true,"_id":"5fcf6c085298a0683b37a758","userId":"5a89ecdaf6b0460c552bf7fd","companyId":"5a89ecdaf6b0460c552bf7fe","type":"automated","vertical":"airlines","datetime":"2020-12-08T12:05:28.372Z","__v":0,"startingBlockId":"1607429128422"},"backId":"1607600760733","argument":{"departureCityInfo":[{"city_name":"SEATTLE","iata_code":"SEA","latitude":47.44889,"longitude":-122.3094,"timezone":"-08:00"}],"departureCity":"seattle","arrivalCityInfo":[{"city_name":"CHICAGO","iata_code":"CHI","latitude":41.85,"longitude":-87.65,"timezone":"-06:00"}],"arrivalCity":"chicago","departureDate":"2020-12-25","flightNumber":""},"userInput":""}} 
Dec 10 04:05:24 KiboChat default error {"path":"api/v1️.1/whatsAppChatbot/airlinesChatbot.logiclayer.js: getFlightSchedulesBlock","message":{},"data":{},"otherInfo":{"chatbot":{"botLinks":{"faqs":"https://kibopush.com/faqs","paymentMethod":"","returnPolicy":""},"stats":{"triggerWordsMatched":1,"newSubscribers":0},"usedBy":0,"triggers":["hi","hello"],"testSubscribers":[],"maxLevels":3,"published":true,"_id":"5fd20ea9d365816ce0f97bd1","userId":"5a89ecdaf6b0460c552bf7fd","companyId":"5a89ecdaf6b0460c552bf7fe","type":"automated","vertical":"airlines","datetime":"2020-12-10T12:03:53.765Z","__v":0,"startingBlockId":"1607601833818"},"backId":"1607601908914","argument":{"departureCityInfo":[{"city_name":"SEATTLE","iata_code":"SEA","latitude":47.44889,"longitude":-122.3094,"timezone":"-08:00"}],"departureCity":"seattle","arrivalCityInfo":[{"city_name":"NEW YORK","iata_code":"NYC","latitude":40.71417,"longitude":-74.00583,"timezone":"-05:00"}],"arrivalCity":"new york","departureDate":"2020-12-25","flightNumber":""},"userInput":""}} 
Dec 10 04:14:36 KiboChat default error {"path":"api/v1️.1/whatsAppChatbot/airlinesChatbot.logiclayer.js: getFlightSchedulesBlock","message":{},"data":{},"otherInfo":{"chatbot":{"botLinks":{"faqs":"https://kibopush.com/faqs","paymentMethod":"","returnPolicy":""},"stats":{"triggerWordsMatched":2,"newSubscribers":0},"usedBy":0,"triggers":["hi","hello"],"testSubscribers":[],"maxLevels":3,"published":true,"_id":"5fd20ea9d365816ce0f97bd1","userId":"5a89ecdaf6b0460c552bf7fd","companyId":"5a89ecdaf6b0460c552bf7fe","type":"automated","vertical":"airlines","datetime":"2020-12-10T12:03:53.765Z","__v":0,"startingBlockId":"1607601833818"},"backId":"1607602462201","argument":{"departureCityInfo":[{"city_name":"SEATTLE","iata_code":"SEA","latitude":47.44889,"longitude":-122.3094,"timezone":"-08:00"}],"departureCity":"seattle","arrivalCityInfo":[{"city_name":"NEW YORK","iata_code":"NYC","latitude":40.71417,"longitude":-74.00583,"timezone":"-05:00"}],"arrivalCity":"new york","departureDate":"2020-12-25","flightNumber":""},"userInput":""}} 
Dec 10 04:18:35 KiboChat default error {"path":"api/v1️.1/whatsAppChatbot/airlinesChatbot.logiclayer.js: getFlightSchedulesBlock","message":{},"data":{},"otherInfo":{"chatbot":{"botLinks":{"faqs":"https://kibopush.com/faqs","paymentMethod":"","returnPolicy":""},"stats":{"triggerWordsMatched":3,"newSubscribers":0},"usedBy":0,"triggers":["hi","hello"],"testSubscribers":[],"maxLevels":3,"published":true,"_id":"5fd20ea9d365816ce0f97bd1","userId":"5a89ecdaf6b0460c552bf7fd","companyId":"5a89ecdaf6b0460c552bf7fe","type":"automated","vertical":"airlines","datetime":"2020-12-10T12:03:53.765Z","__v":0,"startingBlockId":"1607601833818"},"backId":"1607602696738","argument":{"departureCityInfo":[{"city_name":"SEATTLE","iata_code":"SEA","latitude":47.44889,"longitude":-122.3094,"timezone":"-08:00"}],"departureCity":"seattle","arrivalCityInfo":[{"city_name":"NEW YORK","iata_code":"NYC","latitude":40.71417,"longitude":-74.00583,"timezone":"-05:00"}],"arrivalCity":"new york","departureDate":"2020-12-25","flightNumber":""},"userInput":""}} 

https://my.papertrailapp.com/groups/21967562/events?focus=1273657241375002624&selected=1273657241375002624
sentry-io[bot] commented 3 years ago

Sentry issue: KIBOPUSH-2WN

bjafri5 commented 3 years ago

This was occurring if a user entered an incorrect input when asked to select a chatbot. I have added logic to handle invalid inputs. It should now prompt the user to enter a correct number to select a chatbot if they give an invalid input.

@sojharo please test on production

sojharo commented 3 years ago

This is working fine now.