mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-30 11:12:35 +02:00
OrcaCloudService owns an httpx client from construction, and every path in _build_authenticated_service after that point can raise: no stored refresh token, a rejected refresh, an unreachable Orca, and the token-rotation write. On success the caller closes the client. On failure nobody is ever handed it, so all four paths leaked one into the connection pool. That went unnoticed while the only callers were routes, where the trigger is a person retrying a broken sign-in a handful of times. It stopped being harmless in9434875f, which added a caller in spool assignment -- one build per Orca-referenced spool, failing on every assignment for as long as the stored credentials cannot be refreshed. The unwind guard catches BaseException rather than Exception: a cancelled request leaks the client just as surely as a failed refresh, and cancellation during shutdown is exactly when dangling sockets are least welcome. The close inside it is guarded in turn, so a failing cleanup cannot replace the error the caller needs to see -- least of all a CancelledError, which has to keep propagating for cancellation to work at all. Six tests. Four fail against the unguarded builder, verified by reverting the guard and re-running; the other two pin the surrounding contract (a failing close must not mask the real error, and a successful build must leave the client open for its caller) and pass either way. The shared _expired_service helper now gives the mock an awaitable close(), so the four pre-existing refresh tests exercise the same path. Also corrects two comments and the changelog entry from9434875f, which overstated what the captures support. They claimed Bambu Cloud returns a preset's filament_id in either of two places and only one was read. The responses recorded in #1053 show something narrower: a Studio-created preset carries it on the envelope, and an Orca-created one has none at all -- the envelope says null and `setting` is a delta from the base. The `setting` lookup stays as belt-and-braces for a shape no captured response has needed yet, but it is not why a custom profile reached the slicer as its base. That is the OrcaSlicer preset format having no filament_id field, filed upstream as OrcaSlicer PR #13315. The eight-character truncation is now evidenced across three models rather than one -- an A1 storing PFUS9DDC of PFUS9DDC938FE3AB8F, a P1S storing PFUS7A65 of PFUS7A65290D3DADC4, and an H2D storing 8219C45D of an Orca profile UUID.
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel (or oxc when used in rolldown-vite) for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])