1
0
Fork 0
mirror of https://github.com/maziggy/bambuddy.git synced 2026-05-09 08:25:54 +02:00

[PR #408] [CLOSED] Send prints using background dispatcher service #1035

Closed
opened 2026-05-07 00:15:36 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/maziggy/bambuddy/pull/408
Author: @RyanEwen
Created: 2/17/2026
Status: Closed

Base: 0.2.1b2Head: feature/backend_queue


📝 Commits (9)

  • b37f32b Add background print dispatching + tests
  • 66d2707 Fix conflicting var name
  • fd2dd73 Update frontend build
  • d614115 Add background print dispatching + tests
  • 8f139bb Fix conflicting var name
  • efde1f3 Update frontend build
  • 69934d2 Merge remote-tracking branch 'origin/feature/backend_queue' into feature/backend_queue
  • d49a62c Merge branch '0.2.1b' into feature/backend_queue
  • d86d087 Revert changes to chunk sizes and timeouts to A1-safe values.

📊 Changes

23 files changed (+2229 additions, -485 deletions)

View changed files

📝 backend/app/api/routes/archives.py (+29 -119)
backend/app/api/routes/background_dispatch.py (+32 -0)
📝 backend/app/api/routes/library.py (+26 -130)
📝 backend/app/api/routes/websocket.py (+10 -0)
📝 backend/app/main.py (+80 -72)
📝 backend/app/schemas/archive.py (+11 -5)
📝 backend/app/schemas/library.py (+1 -0)
backend/app/services/background_dispatch.py (+857 -0)
📝 backend/app/services/bambu_ftp.py (+57 -9)
backend/tests/integration/test_background_dispatch_api.py (+243 -0)
backend/tests/unit/services/test_background_dispatch.py (+158 -0)
📝 frontend/src/api/client.ts (+23 -2)
📝 frontend/src/components/PrintModal/index.tsx (+25 -14)
📝 frontend/src/contexts/ToastContext.tsx (+440 -11)
📝 frontend/src/hooks/useWebSocket.ts (+8 -1)
📝 frontend/src/i18n/locales/de.ts (+27 -0)
📝 frontend/src/i18n/locales/en.ts (+27 -0)
📝 frontend/src/i18n/locales/it.ts (+27 -0)
📝 frontend/src/i18n/locales/ja.ts (+26 -0)
static/assets/index-C2YsnOJo.css (+1 -0)

...and 3 more files

📄 Description

Description

Decouples file uploads and print start commands so that they run in the background asynchronously. When a print is started, the print modal no longer waits for the print to upload and start. Instead, a new toast-based UI appears with the status of prints being dispatched. Prints being dispatched can be cancelled during upload. If cancelled, the partially-uploaded gcode is deleted from the printer automatically before the FTP connection is closed.

This allows users sending particularly large prints to slow printers such as the P1-series to start a print and then move onto another task in Bambuddy immediately (such as starting more prints on more printers). It also gives the user visibility into what's happening instead of a loading indicator appearing for an indefinite period of time.

The new toast-based UI uses websockets to update in real time. It will also appear for other users / instances of Bambuddy, not just the user who started the prints, allowing more transparency and handling cases where the user closes the page and then comes back wanting to know the status of the dispatching.

Fixes https://github.com/maziggy/bambuddy/issues/112

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test addition or update

Changes Made

  • Add background print dispatcher service.
  • Add toast-based UI to show prints being dispatched.
  • Add tests.

Screenshots

image image

Testing

  • I have tested this on my local machine
  • I have tested with my printer model: P1S

Checklist

  • My code follows the project's coding style
  • I have commented my code where necessary
  • I have updated the documentation (if needed)
  • My changes generate no new warnings
  • I have tested my changes thoroughly

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/maziggy/bambuddy/pull/408 **Author:** [@RyanEwen](https://github.com/RyanEwen) **Created:** 2/17/2026 **Status:** ❌ Closed **Base:** `0.2.1b2` ← **Head:** `feature/backend_queue` --- ### 📝 Commits (9) - [`b37f32b`](https://github.com/maziggy/bambuddy/commit/b37f32ba9995de361ca7b2800567468de411b818) Add background print dispatching + tests - [`66d2707`](https://github.com/maziggy/bambuddy/commit/66d2707775dc00318d04aea0d5f3b51936c65a01) Fix conflicting var name - [`fd2dd73`](https://github.com/maziggy/bambuddy/commit/fd2dd738b567606c8e418ec5e288cde98f883fc6) Update frontend build - [`d614115`](https://github.com/maziggy/bambuddy/commit/d6141154c366321bbbcfcab450cc2bef82ac07b1) Add background print dispatching + tests - [`8f139bb`](https://github.com/maziggy/bambuddy/commit/8f139bbc8f8a001c7d1ad154aa8d5e52081ee007) Fix conflicting var name - [`efde1f3`](https://github.com/maziggy/bambuddy/commit/efde1f3df44374e994c404ee723f1b2e214c00bc) Update frontend build - [`69934d2`](https://github.com/maziggy/bambuddy/commit/69934d2065f49df2ae16445473c9a54e7d06e0f2) Merge remote-tracking branch 'origin/feature/backend_queue' into feature/backend_queue - [`d49a62c`](https://github.com/maziggy/bambuddy/commit/d49a62c7fbec69d95022e0b219810b4cb0b0eb4b) Merge branch '0.2.1b' into feature/backend_queue - [`d86d087`](https://github.com/maziggy/bambuddy/commit/d86d087eb6c9fb00fe6a00afe71a54053962c704) Revert changes to chunk sizes and timeouts to A1-safe values. ### 📊 Changes **23 files changed** (+2229 additions, -485 deletions) <details> <summary>View changed files</summary> 📝 `backend/app/api/routes/archives.py` (+29 -119) ➕ `backend/app/api/routes/background_dispatch.py` (+32 -0) 📝 `backend/app/api/routes/library.py` (+26 -130) 📝 `backend/app/api/routes/websocket.py` (+10 -0) 📝 `backend/app/main.py` (+80 -72) 📝 `backend/app/schemas/archive.py` (+11 -5) 📝 `backend/app/schemas/library.py` (+1 -0) ➕ `backend/app/services/background_dispatch.py` (+857 -0) 📝 `backend/app/services/bambu_ftp.py` (+57 -9) ➕ `backend/tests/integration/test_background_dispatch_api.py` (+243 -0) ➕ `backend/tests/unit/services/test_background_dispatch.py` (+158 -0) 📝 `frontend/src/api/client.ts` (+23 -2) 📝 `frontend/src/components/PrintModal/index.tsx` (+25 -14) 📝 `frontend/src/contexts/ToastContext.tsx` (+440 -11) 📝 `frontend/src/hooks/useWebSocket.ts` (+8 -1) 📝 `frontend/src/i18n/locales/de.ts` (+27 -0) 📝 `frontend/src/i18n/locales/en.ts` (+27 -0) 📝 `frontend/src/i18n/locales/it.ts` (+27 -0) 📝 `frontend/src/i18n/locales/ja.ts` (+26 -0) ➕ `static/assets/index-C2YsnOJo.css` (+1 -0) _...and 3 more files_ </details> ### 📄 Description ## Description Decouples file uploads and print start commands so that they run in the background asynchronously. When a print is started, the print modal no longer waits for the print to upload and start. Instead, a new toast-based UI appears with the status of prints being dispatched. Prints being dispatched can be cancelled during upload. If cancelled, the partially-uploaded gcode is deleted from the printer automatically before the FTP connection is closed. This allows users sending particularly large prints to slow printers such as the P1-series to start a print and then move onto another task in Bambuddy immediately (such as starting more prints on more printers). It also gives the user visibility into what's happening instead of a loading indicator appearing for an indefinite period of time. The new toast-based UI uses websockets to update in real time. It will also appear for other users / instances of Bambuddy, not just the user who started the prints, allowing more transparency and handling cases where the user closes the page and then comes back wanting to know the status of the dispatching. ## Related Issue Fixes https://github.com/maziggy/bambuddy/issues/112 ## Type of Change <!-- Mark the relevant option with an "x" --> - [ ] Bug fix (non-breaking change that fixes an issue) - [x] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Code refactoring - [ ] Performance improvement - [x] Test addition or update ## Changes Made - Add background print dispatcher service. - Add toast-based UI to show prints being dispatched. - Add tests. ## Screenshots <img width="723" height="511" alt="image" src="https://github.com/user-attachments/assets/fa47a299-b51b-4f82-9244-5d10a5dfee85" /> <img width="695" height="411" alt="image" src="https://github.com/user-attachments/assets/f3dcc1b1-b7bd-4983-9eb4-27421d670578" /> ## Testing - [x] I have tested this on my local machine - [x] I have tested with my printer model: P1S ## Checklist - [x] My code follows the project's coding style - [x] I have commented my code where necessary - [ ] I have updated the documentation (if needed) - [x] My changes generate no new warnings - [x] I have tested my changes thoroughly --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-07 00:15:36 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/bambuddy-maziggy-1#1035
No description provided.