Skip to content

Commit e8c4a00

Browse files
fix: make diagnostics export download reliably
1 parent 460492d commit e8c4a00

3 files changed

Lines changed: 36 additions & 22 deletions

File tree

191 KB
Binary file not shown.

folderview.plus.plg

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@
66
<!ENTITY launch "Settings/FolderViewPlus">
77
<!ENTITY plugdir "/usr/local/emhttp/plugins/&name;">
88
<!ENTITY pluginURL "https://raw.githubusercontent.com/&github;/main/folderview.plus.plg">
9-
<!ENTITY version "2026.03.06.3">
10-
<!ENTITY md5 "39ac8cf761703bbef75674f8105c8814">
9+
<!ENTITY version "2026.03.06.4">
10+
<!ENTITY md5 "e906454fc17b52f18e9f9e1530c1377b">
1111
]>
1212

1313
<PLUGIN name="&name;" author="&author;" version="&version;" launch="&launch;" pluginURL="&pluginURL;" icon="folder-open-o" support="https://github.com/alexphillips-dev/FolderView-Plus/issues" min="7.0.0">
1414
<CHANGES>
1515

16+
###2026.03.06.4
17+
- Fix diagnostics export reliability by restoring direct-download behavior.
18+
- Export now defaults to sanitized diagnostics immediately and falls back to cached/latest data if live diagnostics refresh fails.
19+
1620
###2026.03.06.3
1721
- Expand diagnostics export to schema v2 with richer bug-fixing data:
1822
- `integrityChecks` per type (duplicate names/assignments, orphaned members, invalid regex/rules, manual-order gaps),

src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/scripts/folderviewplus.js

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,29 +1236,39 @@ const repairDiagnostics = async (action) => {
12361236
}
12371237
};
12381238

1239-
const exportDiagnostics = async () => {
1240-
swal({
1241-
title: 'Export diagnostics',
1242-
text: 'Include full details (paths, names, and request metadata)?\nChoose Cancel for sanitized export.',
1243-
type: 'warning',
1244-
showCancelButton: true,
1245-
confirmButtonText: 'Full export',
1246-
cancelButtonText: 'Sanitized export'
1247-
}, async (useFull) => {
1248-
const privacy = useFull ? 'full' : 'sanitized';
1239+
const exportDiagnostics = async (privacy = 'sanitized') => {
1240+
const mode = privacy === 'full' ? 'full' : 'sanitized';
1241+
let diagnostics = null;
1242+
1243+
const cachedMode = (lastDiagnostics?.privacyMode || 'sanitized');
1244+
if (lastDiagnostics && cachedMode === mode) {
1245+
diagnostics = lastDiagnostics;
1246+
}
1247+
1248+
if (!diagnostics) {
12491249
try {
1250-
const diagnostics = await getDiagnostics(privacy);
1250+
diagnostics = await getDiagnostics(mode);
12511251
renderDiagnostics(diagnostics);
1252-
downloadFile('FolderView Plus Diagnostics.json', toPrettyJson(diagnostics || {}));
1253-
await trackDiagnosticsEvent({
1254-
eventType: 'diagnostics_export',
1255-
details: {
1256-
privacyMode: privacy,
1257-
schemaVersion: diagnostics?.schemaVersion || null
1258-
}
1259-
});
12601252
} catch (error) {
1261-
showError('Diagnostics export failed', error);
1253+
if (lastDiagnostics) {
1254+
diagnostics = lastDiagnostics;
1255+
} else {
1256+
diagnostics = {
1257+
schemaVersion: 2,
1258+
privacyMode: mode,
1259+
checkedAt: new Date().toISOString(),
1260+
error: error?.message || String(error)
1261+
};
1262+
}
1263+
}
1264+
}
1265+
1266+
downloadFile('FolderView Plus Diagnostics.json', toPrettyJson(diagnostics || {}));
1267+
trackDiagnosticsEvent({
1268+
eventType: 'diagnostics_export',
1269+
details: {
1270+
privacyMode: mode,
1271+
schemaVersion: diagnostics?.schemaVersion || null
12621272
}
12631273
});
12641274
};

0 commit comments

Comments
 (0)