Fix 5 hidden edge cases: IPP decode, settings race, PreviewScreen state sync, burst timeout leak, and logger spam
This commit is contained in:
@@ -91,8 +91,9 @@ export async function printImageLocal(imageUri: string, options: PrintOptions):
|
||||
}
|
||||
console.log('Silent print job accepted successfully!');
|
||||
} catch (e: any) {
|
||||
// If decoding fails, we still assume success since the network request completed successfully
|
||||
console.warn('Failed to parse IPP response, but network request succeeded:', e.message);
|
||||
// If decoding fails, it's a print error. Let it trigger a retry.
|
||||
console.warn('Failed to parse IPP response. The printer may be incompatible or returning malformed data:', e.message);
|
||||
throw e;
|
||||
}
|
||||
|
||||
return; // Success, exit retry loop
|
||||
|
||||
@@ -46,11 +46,9 @@ const DEFAULT_SETTINGS: AppSettings = {
|
||||
*/
|
||||
export async function loadSettings(): Promise<AppSettings> {
|
||||
try {
|
||||
if (settingsFile.exists) {
|
||||
const content = await settingsFile.text();
|
||||
const parsed = JSON.parse(content);
|
||||
return { ...DEFAULT_SETTINGS, ...parsed };
|
||||
}
|
||||
const content = await settingsFile.text();
|
||||
const parsed = JSON.parse(content);
|
||||
return { ...DEFAULT_SETTINGS, ...parsed };
|
||||
} catch (e) {
|
||||
console.error('Failed to load settings, using defaults:', e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user