소스 검색

fix(printer): stop the File Manager polling the printer over FTPS every 30s (#1480)

  FileManagerModal ran its file-listing query with refetchInterval 30000,
  opening a fresh FTPS connection (full TLS handshake) to the printer every
  30s while the modal was open. On fragile controllers like the P1S that
  load tipped MQTT, FTP and the camera into simultaneous timeouts. Drop the
  interval; the listing still refreshes on open, directory change, after
  upload/delete, and via the manual Refresh button.

  Also log STL thumbnail failures with a traceback (exc_info) so a
  data-specific "str / str" TypeError can be located from a support bundle.
maziggy 5 달 전
부모
커밋
50d1984820
5개의 변경된 파일과 15개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 0
      CHANGELOG.md
  2. 6 1
      backend/app/services/stl_thumbnail.py
  3. 6 1
      frontend/src/components/FileManagerModal.tsx
  4. 0 0
      static/assets/index-B7aP7po9.js
  5. 1 1
      static/index.html

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2 - 0
CHANGELOG.md


+ 6 - 1
backend/app/services/stl_thumbnail.py

@@ -142,5 +142,10 @@ def generate_stl_thumbnail(
         logger.warning("STL thumbnail generation unavailable (missing dependencies): %s", e)
         return None
     except Exception as e:
-        logger.warning("Failed to generate STL thumbnail for %s: %s", stl_path, e)
+        # Log the traceback, not just the message: a bare
+        # "unsupported operand type(s) for /: 'str' and 'str'" gives no clue
+        # which line failed, and the fault is data-/environment-specific
+        # enough that it can't be reproduced from a clean STL — the traceback
+        # in the next support bundle is what pinpoints it (#1480).
+        logger.warning("Failed to generate STL thumbnail for %s: %s", stl_path, e, exc_info=True)
         return None

+ 6 - 1
frontend/src/components/FileManagerModal.tsx

@@ -300,10 +300,15 @@ export function FileManagerModal({ printerId, printerName, onClose }: FileManage
     return () => window.removeEventListener('keydown', handleKeyDown);
   }, [onClose]);
 
+  // No auto-poll: every refetch opens a fresh FTPS connection (TLS handshake
+  // and all) to the printer, and a 30s interval saturated fragile printer
+  // controllers like the P1S — MQTT, FTP and the camera all timed out
+  // together while this modal sat open (#1480). A printer's file list only
+  // changes on upload / delete (the mutations below invalidate the query)
+  // or when a print finishes; the manual Refresh button covers the rest.
   const { data, isLoading, refetch } = useQuery({
     queryKey: ['printerFiles', printerId, currentPath],
     queryFn: () => api.getPrinterFiles(printerId, currentPath),
-    refetchInterval: 30000,
   });
 
   const { data: storageData } = useQuery({

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
static/assets/index-B7aP7po9.js


+ 1 - 1
static/index.html

@@ -26,7 +26,7 @@
 
     <!-- Splash screens for iOS -->
     <link rel="apple-touch-startup-image" href="/img/android-chrome-512x512.png" />
-    <script type="module" crossorigin src="/assets/index-B2ysIPjO.js"></script>
+    <script type="module" crossorigin src="/assets/index-B7aP7po9.js"></script>
     <link rel="stylesheet" crossorigin href="/assets/index-CBuiHfeb.css">
   </head>
   <body>

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.