edfcore 0.5.71 → 0.5.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/docs/CHANGELOG.md +45 -0
- package/package.json +1 -1
- package/src/constants.ts +1 -1
package/dist/constants.d.ts
CHANGED
|
@@ -109,5 +109,5 @@ export declare const SIGNAL_FIELD_BLOCK_OFFSETS: {
|
|
|
109
109
|
readonly reserved: 224;
|
|
110
110
|
};
|
|
111
111
|
/** Published package version. Kept in sync with package.json by a test. */
|
|
112
|
-
export declare const VERSION = "0.5.
|
|
112
|
+
export declare const VERSION = "0.5.73";
|
|
113
113
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
package/docs/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,51 @@ alone does not tell you whether you were affected.
|
|
|
6
6
|
edfcore is pre-1.0. Patch releases have carried behaviour changes where the old behaviour was a
|
|
7
7
|
defect; those are called out below.
|
|
8
8
|
|
|
9
|
+
## 0.5.73
|
|
10
|
+
|
|
11
|
+
- **Added** the day the network hiccups. `index.onsetTicks(r)` memoises, which is why `locate()`
|
|
12
|
+
costs `O(log recordCount)` reads instead of repeating them — and memoising is the classic place
|
|
13
|
+
to store a FAILURE by accident. Cache the promise rather than the value and one dropped
|
|
14
|
+
connection is permanent: every later caller awaits the same rejection and no retry ever reaches
|
|
15
|
+
the network. Nothing tested a read that fails and is then tried again.
|
|
16
|
+
- The distinction is invisible until it matters, and it is one small edit away. 0.5.44 pinned that
|
|
17
|
+
concurrent callers of `onsetTicks` all miss the memo, because it holds values and not promises —
|
|
18
|
+
and the obvious way to "fix" that is to hold the promise instead. Making exactly that change
|
|
19
|
+
fails three of the eight checks here, which is the point of writing them down.
|
|
20
|
+
- `a-read-that-failed-is-not-remembered.test.ts` uses a source that rejects a stated number of
|
|
21
|
+
times and then behaves. An onset, a `locate`, and a window are each asked for while it is failing
|
|
22
|
+
and again after, and the answer after has to be the answer a source that never failed would have
|
|
23
|
+
given. The rejection arrives as the caller's own error — `isEdfError` is false for it, because a
|
|
24
|
+
dropped connection says nothing about the recording.
|
|
25
|
+
- `cachedSource` gets the same question, provoked at the first read: it coalesces a small file into
|
|
26
|
+
one range, so by the time a recording is open there is nothing left for a later read to fail at.
|
|
27
|
+
A failed open leaves the cache holding nothing, and the retry through the same cache reads
|
|
28
|
+
correctly.
|
|
29
|
+
- The other half is asserted so none of it passes on a package that simply never caches: a
|
|
30
|
+
SUCCESSFUL read is remembered, two calls for one record cost one read, and a record index that
|
|
31
|
+
cannot exist is refused out of the header without touching the source at all.
|
|
32
|
+
|
|
33
|
+
## 0.5.72
|
|
34
|
+
|
|
35
|
+
- **Added** the case none of the four caller-supplied callbacks documents: what happens when yours
|
|
36
|
+
throws. edfcore calls a `ByteSource.read`, an `onProgress` on each of the two traversals, and a
|
|
37
|
+
predicate on the two matching helpers. Three of the four say what they should RETURN and none of
|
|
38
|
+
the four says what a throw does — which is not exotic: a progress callback writes to a DOM node
|
|
39
|
+
that has been removed, a label predicate calls `toLowerCase` on a signal with no label.
|
|
40
|
+
- Two answers matter and they pull opposite ways. The error must arrive UNCHANGED — the same
|
|
41
|
+
object, not wrapped, not turned into a diagnostic — because wrapping it makes the caller's own bug
|
|
42
|
+
look like a problem with the file, and `isEdfError` has to say false for it. And the recording
|
|
43
|
+
must SURVIVE it: every one of these calls happens partway through something with state, and a
|
|
44
|
+
throw unwinds through all of it.
|
|
45
|
+
- `when-your-callback-throws.test.ts` checks both for the three that had nothing;
|
|
46
|
+
`source-contract.test.ts` already covers the source. After a callback throws mid-scan, the same
|
|
47
|
+
recording rebuilds to the same index, validates to the same verdict, and leaves the annotation
|
|
48
|
+
array it was given untouched — each compared against a recording that never saw a failure.
|
|
49
|
+
- One check is about the failure a memoised promise would produce: a second attempt has to reach
|
|
50
|
+
the callback again rather than a remembered rejection, or one bad progress callback breaks the
|
|
51
|
+
operation for the life of the recording. Wrapping the progress call in a `try`/`catch` that
|
|
52
|
+
swallows fails three of the nine.
|
|
53
|
+
|
|
9
54
|
## 0.5.71
|
|
10
55
|
|
|
11
56
|
- **Added** the case every diagnostic test avoids: a file with more than one thing wrong with it.
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED