Fix external spool ams_mapping2 slot_id (Issue #213)

The ams_mapping2 format was incorrectly using the tray_id (254/255) as
the slot_id for external spools. The printer expects slot_id to be the
actual slot index (0 for main nozzle, 1 for deputy nozzle), not the
tray_id value.

Before: {"ams_id": 255, "slot_id": 254}  <- invalid slot index
After:  {"ams_id": 255, "slot_id": 0}    <- correct slot index

This caused prints using external spool to fail immediately with error
code 07FF_8007.

Closes #213
This commit is contained in:
maziggy
2026-02-01 16:29:37 +01:00
parent 234693a306
commit 57db7932e7
3 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -273,7 +273,7 @@ export const handlers = [
// Auth
// ========================================================================
http.get('/api/v1/auth/status', () => {
http.get('*/api/v1/auth/status', () => {
return HttpResponse.json({
auth_enabled: false,
requires_setup: false,
+4 -9
View File
@@ -11,17 +11,12 @@ import { server } from './mocks/server';
// Initialize i18n for tests (suppresses react-i18next warnings)
import '../i18n';
// Setup MSW server - bypass WebSocket requests so our mock handles them
// Setup MSW server
beforeAll(() =>
server.listen({
onUnhandledRequest: (request, _print) => {
// Allow WebSocket requests to pass through to our mock
if (request.url.includes('/ws')) {
return;
}
// Silently ignore unhandled requests in tests to reduce noise
// Remove 'warn' to completely silence, or use print.warning() to show warnings
},
// Bypass unhandled requests silently (don't warn, just let them through)
// Handlers use wildcard (*) prefix to match any origin
onUnhandledRequest: 'bypass',
})
);
afterEach(() => {
+5
View File
@@ -7,6 +7,11 @@ export default defineConfig({
test: {
globals: true,
environment: 'jsdom',
environmentOptions: {
jsdom: {
url: 'http://localhost:3000',
},
},
setupFiles: ['./src/__tests__/setup.ts'],
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
exclude: ['node_modules', 'dist'],