inseokr / MERN_linkedspace

2 stars 1 forks source link

Group channel is not created properly in the parent listing #659

Closed inseokr closed 3 years ago

inseokr commented 3 years ago

Channel couldn't be found (node:19924) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'channel_id' of null at C:\Users\inseo\linkedspaces\master\MERN_linkedspace\src\server\db_utilities\chatting_db\access_chat_db.js:67:74 at new Promise () at Object.addChannelToSingleUser (C:\Users\inseo\linkedspaces\master\MERN_linkedspace\src\server\db_utilities\chatting_db\access_chat_db.js:62:10) at C:\Users\inseo\linkedspaces\master\MERN_linkedspace\src\server\routes\chatting\index.js:62:18 at processTicksAndRejections (internal/process/task_queues.js:97:5) (node:19924) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) (node:19924) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. removeSocket: userName = inseo SOCKET IS BEING DISCONNECTED!!!!!!!!!!!!!!!!!!!! (node:19924) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'channel_id' of null at C:\Users\inseo\linkedspaces\master\MERN_linkedspace\src\server\db_utilities\chatting_db\access_chat_db.js:67:74 at new Promise () at Object.addChannelToSingleUser (C:\Users\inseo\linkedspaces\master\MERN_linkedspace\src\server\db_utilities\chatting_db\access_chat_db.js:62:10) at C:\Users\inseo\linkedspaces\master\MERN_linkedspace\src\server\routes\chatting\index.js:62:18 at processTicksAndRejections (internal/process/task_queues.js:97:5) (node:19924) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)

inseokr commented 3 years ago

The group channel is created only after typing another message?

inseokr commented 3 years ago

It is added to list_of_group_chats at least.

inseokr commented 3 years ago

Client's not sending "new" API for the group channel, but sending update API instead.

pushCurrentChannelToDD will trigger update API.

Let's check where we're generating new API for group channel.

inseokr commented 3 years ago

This is happening because loadChattingDatabase is called 2 times.

  1. loadChattingDatabase without any parameter
  2. loadChattingDatabase with specific parameter
inseokr commented 3 years ago

The following 2 information should be provided.

  1. channelName
  2. members ==> currChannelInfo

requestedChannel.channelName, members: requestedChannel.members

_contactState does have the information. indisde channelInfo