You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 3, 2026. It is now read-only.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,9 @@ The format follows Keep a Changelog and the project adheres to Semantic Versioni
21
21
-`writeFileFromPath(path, sourceFsPath, opts)` to avoid manual source `File` management.
22
22
- New `examples/LargeFileStreaming` sketch showing chunked large-binary streaming with streaming hash verification.
23
23
- New `examples/AsyncLargeFileUpload` sketch showing background large-binary upload with progress polling and hash verification.
24
+
- File discovery APIs for persisted uploads:
25
+
-`getFileInfo(path)` for per-path metadata lookup
26
+
-`listFiles(prefix, recursive)` for directory-style discovery under `/_files`
24
27
25
28
### Changed
26
29
-`init()` now skips collections listed in `delayedCollectionSyncArray` during eager preload; deferred collections are loaded on first periodic autosync tick (or first `syncNow()` when `autosync=false`) and still load immediately on first explicit `collection(name)` access.
@@ -37,6 +40,11 @@ The format follows Keep a Changelog and the project adheres to Semantic Versioni
37
40
- Async upload state retention is now bounded: terminal upload states are kept only for a recent window of upload IDs.
38
41
- Updated `examples/FileStreaming` and file storage tests to cover callback/path convenience write flows.
39
42
43
+
### Fixed
44
+
- Collection cleanup on sync now reports filesystem removal errors instead of silently succeeding when a collection directory or document file cannot be deleted.
45
+
- Recursive collection and `dropAll()` cleanup now removes directories consistently across Arduino-ESP32 and ESP-IDF builds.
46
+
- Added hardware tests that verify collection directories and document files actually disappear from LittleFS after sync-driven cleanup.
47
+
40
48
### Removed
41
49
- Legacy `onSync(std::function<void()>)` callback API (breaking change). Use `onSyncStatus(...)` instead.
Copy file name to clipboardExpand all lines: README.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -115,6 +115,9 @@ db.writeFileStream(
115
115
},
116
116
fileOpts
117
117
);
118
+
119
+
auto fileInfo = db.getFileInfo("notes/readme.txt");
120
+
auto fileTree = db.listFiles("firmware", true);
118
121
```
119
122
120
123
## Gotchas
@@ -125,6 +128,8 @@ db.writeFileStream(
125
128
- `writeFileStream()` and `readFileStream()` hold the filesystem lock while processing the stream; use reasonable chunk sizes and avoid blocking stream sources/sinks.
126
129
- `writeFileStreamAsync()` runs producer callbacks on a background task; callbacks must be short and thread-safe.
127
130
- `getFileUploadState(uploadId)` retains terminal states for a bounded number of recent uploads; older upload IDs eventually return `NotFound`.
131
+
- Uploaded files are not surfaced as collections or snapshots; use `getFileInfo()` / `listFiles()` to inspect persisted file storage under `/_files`.
132
+
- `dropCollection()` only schedules on-disk removal; the collection directory and document files are deleted on the next autosync pass or `syncNow()`.
128
133
- `/_files` is an internal reserved directory used for file storage and cannot be used as a collection name.
129
134
- `getSnapshot()` and `restoreFromSnapshot()` currently cover document collections only; file storage under `/_files` is not included.
130
135
- `usePSRAMBuffers` affects ESPJsonDB-owned byte buffers, decoded `DocView` `JsonDocument` pools on ArduinoJson v7, and long-lived internal DB containers (collection/schema/upload/diag maps and queues). Public return containers like `readFile()` still use the existing API types.
@@ -137,6 +142,7 @@ db.writeFileStream(
137
142
- `void onSyncStatus(std::function<void(const DBSyncStatus&)>)` – observe cold preload and `syncNow()` progress with stage/source/current collection counters.
138
143
- `onSync(std::function<void()>)` was removed; migrate to `onSyncStatus(...)`.
- `dropCollection(name)` removes in-memory state immediately and deletes the corresponding filesystem directory on the next autosync pass or explicit `syncNow()`.
140
146
- Document helpers:
141
147
- Create: `create`, `createMany` (JSON array) plus direct `Collection::create*` variants.
142
148
- Read: `findById`, `findOne`, `findMany` (predicate or JSON filter) returning `DocView` so you can read/write lazily.
@@ -153,6 +159,8 @@ db.writeFileStream(
153
159
- `cancelFileUpload(uploadId)`, `getFileUploadState(uploadId)` for async job control (terminal states are retained for a bounded recent window).
154
160
- `writeFile(path, data, size)` / `readFile(path)` for direct byte buffers.
155
161
- `writeTextFile(path, text)` / `readTextFile(path)` for UTF-8 or plain text payloads.
162
+
- `getFileInfo(path)` returns a JSON object with `path`, `name`, `exists`, `isDirectory`, and `size`.
163
+
- `listFiles(prefix, recursive)` returns a JSON document with `prefix`, `recursive`, and an `entries` array of file/directory metadata objects.
156
164
- `fileExists(path)`, `fileSize(path)`, `removeFile(path)` for file lifecycle utilities.
157
165
- File paths are relative to `/<baseDir>/_files` and path traversal segments are rejected.
158
166
- `ESPJsonDBFileOptions`: `overwrite` and `chunkSize` controls for stream writes.
0 commit comments