codeuino / social-platform-donut-backend

Donut API:
http://donut-api-prod.codeuino.org/
GNU General Public License v3.0
24 stars 57 forks source link

Notification system using socket.io, remove user/admin, case-insensitive functionality #135

Closed Rupeshiya closed 4 years ago

Rupeshiya commented 4 years ago

name: Pull Request template about: Describe the PR. title: '' labels: '' assignees: ''


Problem

Github Issue Number: #134 #136 As of now, there is no backend for the notification system, so users of the platform would not be able to get any type of real-time notifications. Like if any event is going to be hosted by the org, or org is kept under maintenance, or user A follows user B, etc. So in all those cases, the user will not be able to get any notifications _

Solution of problem

Implement backend for notifications system using socket.io and node.js and store that in DB for first-time page load.

Type of Change

[ ] Bug fix [✓] New Feature [ ] Development of UI/UX prototypes [✓] Small refactor [ ] Change in Documentation

Checklist

[✓] My code follows the same style as the codebase [ ] My Code change requires a change in documentation [ ] I have updated the Readme accordingly [✓] I made PR against development branch [✓] I have run the test cases locally and it's passing. [✓] I have squashed my commits

devesh-verma commented 4 years ago

@Rupeshiya conflicts

Rupeshiya commented 4 years ago

@devesh-verma One test case is failing as soket.io is listening on another PORT address, so jest giving open handle error.

vaibhavdaren commented 4 years ago

can you explain this await new Promise((resolve) => setTimeout(() => resolve(), 500))

Rupeshiya commented 4 years ago

can you explain this await new Promise((resolve) => setTimeout(() => resolve(), 500))

@vaibhavdaren during the shutdown of superset, somewhere the thread is not waiting for an async system operation to finish. Thus, the operation is delegated to the system but the execution is not blocked or does not wait for the async operation to finish. In the meantime, the test case execution finishes, jest is shutting down and complains about an open handle. So this is making the jest to wait for some time to finish the execution and disable the open handle issue, during npm run test

vaibhavdaren commented 4 years ago

can you explain this await new Promise((resolve) => setTimeout(() => resolve(), 500))

@vaibhavdaren during the shutdown of superset, somewhere the thread is not waiting for an async system operation to finish. Thus, the operation is delegated to the system but the execution is not blocked or does not wait for the async operation to finish. In the meantime, the test case execution finishes, jest is shutting down and complains about an open handle. So this is making the jest to wait for some time to finish the execution and disable the open handle issue, during npm run test

So , jest stops execution before the async call finishes?

Rupeshiya commented 4 years ago

can you explain this await new Promise((resolve) => setTimeout(() => resolve(), 500))

@vaibhavdaren during the shutdown of superset, somewhere the thread is not waiting for an async system operation to finish. Thus, the operation is delegated to the system but the execution is not blocked or does not wait for the async operation to finish. In the meantime, the test case execution finishes, jest is shutting down and complains about an open handle. So this is making the jest to wait for some time to finish the execution and disable the open handle issue, during npm run test

So , jest stops execution before the async call finishes?

yes, for some cases. And creating open handle issue.

vaibhavdaren commented 4 years ago

can you explain this await new Promise((resolve) => setTimeout(() => resolve(), 500))

@vaibhavdaren during the shutdown of superset, somewhere the thread is not waiting for an async system operation to finish. Thus, the operation is delegated to the system but the execution is not blocked or does not wait for the async operation to finish. In the meantime, the test case execution finishes, jest is shutting down and complains about an open handle. So this is making the jest to wait for some time to finish the execution and disable the open handle issue, during npm run test

So , jest stops execution before the async call finishes?

yes, for some cases. And creating open handle issue.

Rupeshiya commented 4 years ago

@vaibhavdaren @devesh-verma Done all the requested changes!