mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-09 07:25:44 +02:00
Fix timelapse auto-download and browser tab crash on print completion
1. Timelapse auto-download rewrite (main.py) - New retry mechanism with short delays (5s, 10s, 20s) - Grabs most recent file directly without mtime comparison - Works with printers that have wrong clock (LAN-only mode) - Checks multiple paths: /timelapse, /timelapse/video, /record, /recording 2. Browser tab crash fix (PrintersPage.tsx) - Throttled query cache subscription using requestAnimationFrame - Prevents rapid re-render cascade on print completion events 3. WebSocket optimization (main.py) - Removed large raw_data field from print_complete message - Only sends necessary fields: status, filename, subtask_name, timelapse_was_active 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
4b8e6ca797
commit
ca2bd6bf57
@@ -453,10 +453,18 @@ function StatusSummaryBar({ printers }: { printers: Printer[] | undefined }) {
|
||||
}, [printers, queryClient]);
|
||||
|
||||
// Subscribe to query cache changes to re-render when status updates
|
||||
// Throttled to prevent rapid re-renders from causing tab crashes
|
||||
const [, setTick] = useState(0);
|
||||
useEffect(() => {
|
||||
let pending = false;
|
||||
const unsubscribe = queryClient.getQueryCache().subscribe(() => {
|
||||
setTick(t => t + 1);
|
||||
if (!pending) {
|
||||
pending = true;
|
||||
requestAnimationFrame(() => {
|
||||
setTick(t => t + 1);
|
||||
pending = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
return () => unsubscribe();
|
||||
}, [queryClient]);
|
||||
|
||||
Reference in New Issue
Block a user