Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Websockets #7724

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
Draft

WIP: Websockets #7724

wants to merge 12 commits into from

Conversation

matmair
Copy link
Member

@matmair matmair commented Jul 24, 2024

This PR is heavy WIP!! Do not run this in production

This PR adds ASGI support to the backend setup

  • Adds daphne for ASGI support for runserver
  • Adds uvicorn_worker to the gunicorn setup to enable handling both WSGI and ASGI
  • Adds routing logic for ASGI
  • Adds a first async component: PageAttendanceDrawer. This shows other users that are on the same page right now and allows temporary discussions right there

Tasks

Closes #6262

@matmair matmair added this to the 1.0.0 milestone Jul 24, 2024
Copy link

netlify bot commented Jul 24, 2024

Deploy Preview for inventree-web-pui-preview ready!

Name Link
🔨 Latest commit d927321
🔍 Latest deploy log https://app.netlify.com/sites/inventree-web-pui-preview/deploys/66e09228bf53e40008d773e7
😎 Deploy Preview https://deploy-preview-7724--inventree-web-pui-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 86 (no change from production)
Best Practices: 92 (no change from production)
SEO: 70 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

sonarcloud bot commented Jul 24, 2024

Copy link

codecov bot commented Jul 24, 2024

Codecov Report

Attention: Patch coverage is 39.53488% with 52 lines in your changes missing coverage. Please review.

Project coverage is 84.25%. Comparing base (30ab365) to head (d927321).

Files with missing lines Patch % Lines
src/backend/InvenTree/web/consumers.py 0.00% 33 Missing ⚠️
...end/src/components/nav/PageAttendanceComponent.tsx 79.48% 8 Missing ⚠️
src/backend/InvenTree/InvenTree/asgi.py 0.00% 7 Missing ⚠️
src/backend/InvenTree/InvenTree/routing.py 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7724      +/-   ##
==========================================
+ Coverage   83.75%   84.25%   +0.50%     
==========================================
  Files        1143     1148       +5     
  Lines       51084    51252     +168     
  Branches     1790     1794       +4     
==========================================
+ Hits        42787    43184     +397     
- Misses       7836     7857      +21     
+ Partials      461      211     -250     
Flag Coverage Δ
backend 85.62% <6.38%> (-0.09%) ⬇️
pui 68.98% <79.48%> (+4.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wolflu05
Copy link
Contributor

Nice that you're starting working on this, this may later can be used to stream the machine status page in real time if there are any changes one e.g. machine states, errors, ...

@matmair
Copy link
Member Author

matmair commented Jul 24, 2024

It will also enable removing polling jobs fully and integrating with mqtt within plugins. Due to changes to the gunicorn config, I am a bit cautious - this should probably be targeted to 0.17.0

@matmair matmair marked this pull request as ready for review July 24, 2024 22:09
@matmair matmair marked this pull request as draft July 24, 2024 22:09
@matmair matmair self-assigned this Jul 26, 2024
@matmair matmair added enhancement This is an suggested enhancement or new feature api Relates to the API setup Relates to the InvenTree setup / installation process Platform UI Related to the React based User Interface labels Jul 26, 2024
@matmair matmair modified the milestones: 1.0.0, 0.17.0 Aug 9, 2024
@matmair
Copy link
Member Author

matmair commented Sep 10, 2024

@SchrodingersGat @wolflu05 I am facing some issues with CORS on the static icons as seen in recent tests. I can not figure out what is happening here and this is blocking the whole PR as it is failing all PUI tests. Have any of you an idea what this could be?

@wolflu05
Copy link
Contributor

Not sure, it seems that the frontend is hosted on a different port than the server for the playwright tests and cors is not allowed on the server?

@matmair matmair modified the milestones: 0.17.0, 1.0.0 Nov 12, 2024
@matmair matmair mentioned this pull request Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Relates to the API enhancement This is an suggested enhancement or new feature Platform UI Related to the React based User Interface setup Relates to the InvenTree setup / installation process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] Switch to websockets for progress bars/notifications
2 participants