cursedbelt-server 4.48.0 → 4.48.1
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/server/activity/store.d.ts +1 -1
- package/dist/server/analytics/injectedScripts.d.ts +1 -1
- package/dist/server/analytics/injectedScripts.js +1 -1
- package/dist/server/analytics/webAnalytics.d.ts +1 -1
- package/dist/server/analytics/webAnalytics.js +1 -1
- package/dist/server/auth/loginThrottleDurable.d.ts +3 -3
- package/dist/server/auth/loginThrottleDurable.js +3 -3
- package/dist/server/auth/passwordCost.js +1 -1
- package/dist/server/ctgrChunkDurable.d.ts +1 -1
- package/dist/server/ctgrChunkDurable.js +1 -1
- package/dist/server/d1/backup.d.ts +1 -1
- package/dist/server/d1/backup.js +1 -1
- package/dist/server/d1/http.d.ts +2 -2
- package/dist/server/d1/http.js +2 -2
- package/dist/server/d1/invocation.js +1 -1
- package/dist/server/d1/limits.d.ts +1 -1
- package/dist/server/d1/limits.js +1 -1
- package/dist/server/d1/scheduling.d.ts +1 -1
- package/dist/server/d1/scheduling.js +1 -1
- package/dist/server/d1/types.d.ts +1 -1
- package/dist/server/d1/types.js +1 -1
- package/dist/server/d1/values.d.ts +1 -1
- package/dist/server/d1/values.js +1 -1
- package/dist/server/dropzone/scan.d.ts +1 -1
- package/dist/server/engagement/index.d.ts +1 -1
- package/dist/server/engagement/index.js +1 -1
- package/dist/server/guard/argon2Binding.js +1 -1
- package/dist/server/guard/kdfWorkerEntry.js +2 -2
- package/dist/server/incidents/index.d.ts +1 -1
- package/dist/server/incidents/index.js +1 -1
- package/dist/server/incidents/store.d.ts +1 -1
- package/dist/server/incidents/store.js +1 -1
- package/dist/server/jobs/timeout.d.ts +1 -1
- package/dist/server/jobs/timeout.js +1 -1
- package/dist/server/master-lock/accountsPage.d.ts +1 -1
- package/dist/server/master-lock/accountsPage.js +2 -2
- package/dist/server/master-lock/guard.js +1 -1
- package/dist/server/master-lock/lockPage.d.ts +1 -1
- package/dist/server/master-lock/lockPage.js +2 -2
- package/dist/server/master-lock/masterLock.d.ts +2 -2
- package/dist/server/master-lock/masterLock.js +2 -2
- package/dist/server/metrics/normalizeRoute.js +1 -1
- package/dist/server/metrics/telemetrySink.d.ts +2 -2
- package/dist/server/metrics/telemetrySink.js +1 -1
- package/dist/server/middleware/zValidator.js +2 -2
- package/dist/server/notifications/hub.js +1 -1
- package/dist/server/requestLog/requestMetrics.d.ts +2 -2
- package/dist/server/requestLog/requestMetrics.js +2 -2
- package/dist/server/retention/archive.d.ts +1 -1
- package/dist/server/retention/archive.js +2 -2
- package/dist/server/satellite/config.js +2 -2
- package/dist/server/satellite/door.d.ts +1 -1
- package/dist/server/sharing/contract.d.ts +1 -1
- package/dist/server/storage/binaryStore.d.ts +1 -1
- package/dist/server/storage/binaryStore.js +3 -3
- package/dist/server/storage/derivatives.d.ts +2 -2
- package/dist/server/storage/derivatives.js +2 -2
- package/dist/server/storage/files/adapter.d.ts +2 -2
- package/dist/server/storage/files/adapter.js +10 -10
- package/dist/server/storage/files/catalogue.d.ts +1 -1
- package/dist/server/storage/files/catalogue.js +4 -4
- package/dist/server/storage/files/chunkedUpload.d.ts +2 -2
- package/dist/server/storage/files/chunkedUpload.js +1 -1
- package/dist/server/storage/files/fileRoutes.d.ts +1 -1
- package/dist/server/storage/files/fileRoutes.js +4 -4
- package/dist/server/storage/files/mimeByExt.js +1 -1
- package/dist/server/storage/files/stack.d.ts +2 -2
- package/dist/server/storage/files/types.d.ts +4 -4
- package/dist/server/storage/files/types.js +1 -1
- package/dist/server/storage/index.js +1 -1
- package/dist/server/storage/objectStoreMediaStore.js +1 -1
- package/dist/server/storage/transcodeJobs.js +5 -5
- package/dist/server/storage/types.d.ts +1 -1
- package/dist/server/storage/types.js +1 -1
- package/dist/server/storage/videoDerivativeKeys.d.ts +1 -1
- package/dist/server/storage/videoDerivativeKeys.js +1 -1
- package/dist/server/storage/videoProcessor.js +1 -1
- package/dist/server/sync/status.d.ts +1 -1
- package/dist/server/zipStream.d.ts +1 -1
- package/dist/server/zipStream.js +1 -1
- package/docs/activity.md +2 -2
- package/docs/retention.md +2 -2
- package/package.json +1 -1
- package/src/leafSubpathsImportNothing.spec.ts +1 -1
- package/src/namedSubpathsResolve.spec.ts +1 -1
- package/src/noTimerDialsAPeer.spec.ts +1 -1
- package/src/nodeBuiltinsAreProbedByCalling.spec.ts +1 -1
- package/src/publishShape.spec.ts +1 -1
- package/src/server/activity/store.ts +1 -1
- package/src/server/analytics/injectedScripts.spec.ts +1 -1
- package/src/server/analytics/injectedScripts.ts +1 -1
- package/src/server/analytics/webAnalytics.ts +1 -1
- package/src/server/auth/loginThrottleDurable.ts +3 -3
- package/src/server/auth/passwordCost.ts +1 -1
- package/src/server/bench/cpuBudget.spec.ts +1 -1
- package/src/server/bench/tail.spec.ts +1 -1
- package/src/server/ctgrChunkDurable.ts +1 -1
- package/src/server/d1/backup.spec.ts +1 -1
- package/src/server/d1/backup.ts +1 -1
- package/src/server/d1/http.ts +2 -2
- package/src/server/d1/invocation.spec.ts +1 -1
- package/src/server/d1/invocation.ts +1 -1
- package/src/server/d1/limits.ts +1 -1
- package/src/server/d1/pullD1.spec.ts +1 -1
- package/src/server/d1/scheduling.ts +1 -1
- package/src/server/d1/types.ts +1 -1
- package/src/server/d1/values.ts +1 -1
- package/src/server/dropzone/scan.spec.ts +2 -2
- package/src/server/dropzone/scan.ts +1 -1
- package/src/server/engagement/engagement.spec.ts +1 -1
- package/src/server/engagement/index.ts +1 -1
- package/src/server/google-oauth/googleOAuth.spec.ts +1 -1
- package/src/server/guard/argon2Binding.ts +1 -1
- package/src/server/guard/kdfWorkerEntry.ts +2 -2
- package/src/server/incidents/index.ts +1 -1
- package/src/server/incidents/store.ts +1 -1
- package/src/server/jobs/timeout.ts +1 -1
- package/src/server/master-lock/accountsPage.spec.ts +2 -2
- package/src/server/master-lock/accountsPage.ts +2 -2
- package/src/server/master-lock/beaconNeverReachesTheWall.spec.ts +2 -2
- package/src/server/master-lock/guard.spec.ts +2 -2
- package/src/server/master-lock/guard.ts +1 -1
- package/src/server/master-lock/lockPage.spec.ts +1 -1
- package/src/server/master-lock/lockPage.ts +2 -2
- package/src/server/master-lock/masterLock.spec.ts +1 -1
- package/src/server/master-lock/masterLock.ts +2 -2
- package/src/server/master-lock/sessions.spec.ts +1 -1
- package/src/server/metrics/normalizeRoute.ts +1 -1
- package/src/server/metrics/telemetrySink.ts +3 -3
- package/src/server/middleware/bodyLimit.spec.ts +1 -1
- package/src/server/middleware/zValidator.spec.ts +3 -3
- package/src/server/middleware/zValidator.ts +3 -3
- package/src/server/notifications/hub.ts +1 -1
- package/src/server/requestLog/requestMetrics.spec.ts +2 -2
- package/src/server/requestLog/requestMetrics.ts +3 -3
- package/src/server/retention/archive.spec.ts +2 -2
- package/src/server/retention/archive.ts +2 -2
- package/src/server/satellite/config.ts +2 -2
- package/src/server/satellite/door.ts +1 -1
- package/src/server/satellite/satellite.spec.ts +1 -1
- package/src/server/sharing/contract.ts +1 -1
- package/src/server/storage/binaryServerProcessing.spec.ts +1 -1
- package/src/server/storage/binaryServerProcessing.ts +4 -4
- package/src/server/storage/binaryStore.spec.ts +6 -6
- package/src/server/storage/binaryStore.ts +4 -4
- package/src/server/storage/chunked.integration.spec.ts +2 -2
- package/src/server/storage/derivatives.ts +2 -2
- package/src/server/storage/fileUploadClient.integration.spec.ts +1 -1
- package/src/server/storage/files/adapter.photo.spec.ts +2 -2
- package/src/server/storage/files/adapter.spec.ts +3 -3
- package/src/server/storage/files/adapter.ts +10 -10
- package/src/server/storage/files/catalogue.spec.ts +1 -1
- package/src/server/storage/files/catalogue.ts +4 -4
- package/src/server/storage/files/chunkedUpload.spec.ts +5 -5
- package/src/server/storage/files/chunkedUpload.ts +3 -3
- package/src/server/storage/files/fileRoutes.spec.ts +3 -3
- package/src/server/storage/files/fileRoutes.ts +5 -5
- package/src/server/storage/files/mimeByExt.ts +1 -1
- package/src/server/storage/files/stack.ts +3 -3
- package/src/server/storage/files/types.ts +6 -6
- package/src/server/storage/index.ts +1 -1
- package/src/server/storage/objectStoreMediaStore.ts +1 -1
- package/src/server/storage/sources.ts +1 -1
- package/src/server/storage/transcodeJobs.ts +5 -5
- package/src/server/storage/types.ts +2 -2
- package/src/server/storage/uploadSession.spec.ts +1 -1
- package/src/server/storage/videoDerivativeKeys.spec.ts +3 -3
- package/src/server/storage/videoDerivativeKeys.ts +1 -1
- package/src/server/storage/videoProcessor.ts +1 -1
- package/src/server/sync/status.ts +1 -1
- package/src/server/sync/timer.spec.ts +1 -1
- package/src/server/worker-argon2/index.spec.ts +1 -1
- package/src/server/zipStream.spec.ts +2 -2
- package/src/server/zipStream.ts +1 -1
- package/src/shippedFilesAreTracked.spec.ts +2 -2
|
@@ -23,13 +23,13 @@ import type { FileCatalogue } from './types.js';
|
|
|
23
23
|
|
|
24
24
|
// ── Files stack — the host recipe ───────────────────────────────────────────────
|
|
25
25
|
// One call that assembles the whole files/media server stack a host would otherwise hand-wire:
|
|
26
|
-
// migrations + SQLite
|
|
26
|
+
// migrations + SQLite catalog over a MediaStore, the stream-token service, the media/file URL
|
|
27
27
|
// builders, the catalogue-as-video-source registered in a SourceRegistry, and a `mount()` that
|
|
28
28
|
// wires every byte/upload route onto a Hono app. The auth seam (session → MediaCtx) stays
|
|
29
29
|
// host-injected — the stack owns no auth.
|
|
30
30
|
|
|
31
31
|
export interface FilesStackOptions {
|
|
32
|
-
/** The
|
|
32
|
+
/** The catalog database. The stack runs FILE_CATALOGUE_MIGRATIONS on it itself. */
|
|
33
33
|
db: Database;
|
|
34
34
|
/** Byte backend (disk / binary-server / s3) — the swappable piece. */
|
|
35
35
|
store: MediaStore;
|
|
@@ -83,7 +83,7 @@ export interface FilesStackOptions {
|
|
|
83
83
|
backfillPosters?: boolean;
|
|
84
84
|
/** Wire LARGE-file chunked uploads (direct-to-backend). Give the backend-specific per-chunk URL
|
|
85
85
|
* minter (for binary-server: a signed `${base}/upload-chunk/${app}/${key}?token=`) and the stack
|
|
86
|
-
* builds the ChunkedUploadService over its own
|
|
86
|
+
* builds the ChunkedUploadService over its own catalog + a storage-ops ledger on `db`, then
|
|
87
87
|
* mount() auto-wires the /upload-init, /upload-complete, /upload-abort routes. Omit ⇒ chunked is
|
|
88
88
|
* off and clients fall back to the streamed single PUT (disk-only deploys). */
|
|
89
89
|
chunkedUpload?: {
|
|
@@ -2,8 +2,8 @@ import type { PlayableVideo, ProcessingStatus } from 'cursedbelt-core/media';
|
|
|
2
2
|
import type { MediaCtx } from '../types.js';
|
|
3
3
|
|
|
4
4
|
// ── FileCatalogue: a tagged flat file system over the storage layer ──────────────
|
|
5
|
-
// A production-shaped, SQLite-backed
|
|
6
|
-
// docs, code).
|
|
5
|
+
// A production-shaped, SQLite-backed catalog of a user's binaries (images, video, audio,
|
|
6
|
+
// docs, code). Generalizes the video-only gallery source into ONE source of truth: the gallery
|
|
7
7
|
// becomes a video-filtered view over it. Improves on ca's fs_nodes: FLAT (no folder tree), the
|
|
8
8
|
// smart-view `fileType` is STORED at write (not re-derived per request), tags are a JOIN table
|
|
9
9
|
// (indexed facets, not a JSON scan), listing is CURSOR-paginated, and processing state is typed
|
|
@@ -61,7 +61,7 @@ export type TagFacet = { tag: string; count: number };
|
|
|
61
61
|
/** A page of results with an opaque cursor for the next page (cursor-keyed, not OFFSET). */
|
|
62
62
|
export type FilePage = { items: FileRecord[]; nextCursor?: string };
|
|
63
63
|
|
|
64
|
-
/** Every listing order the
|
|
64
|
+
/** Every listing order the catalog understands — the single source of truth the route layer
|
|
65
65
|
* validates against and the `FileSort` union derives from. `recent` = newest first (default);
|
|
66
66
|
* `oldest` = oldest first; `name` = A→Z; `size` = largest first; `random` = a seeded shuffle
|
|
67
67
|
* (the seed is minted per session and folded into the cursor, so a visit reshuffles but its own
|
|
@@ -108,7 +108,7 @@ export function classifyFileType(mime: string, isText = false): FileType {
|
|
|
108
108
|
return 'other';
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
/** The
|
|
111
|
+
/** The catalog contract. A SQLite implementation is the production default; the interface lets
|
|
112
112
|
* an app swap it. All calls are owner-scoped via {@link MediaCtx} (one tenant never sees another). */
|
|
113
113
|
/** Cheap owner-scoped aggregates (COUNT/SUM over the files table) — the admin
|
|
114
114
|
* surface's "site stats" source. */
|
|
@@ -138,7 +138,7 @@ export interface FileCatalogue {
|
|
|
138
138
|
},
|
|
139
139
|
): Promise<FileRecord>;
|
|
140
140
|
/** Register bytes uploaded OUT OF BAND (a chunked upload sent direct to the backend) — insert the
|
|
141
|
-
* row + kick processing WITHOUT re-storing bytes (they already sit at the
|
|
141
|
+
* row + kick processing WITHOUT re-storing bytes (they already sit at the catalog's key for this
|
|
142
142
|
* id: fsSourceKey for video, fileBinaryKey otherwise). */
|
|
143
143
|
registerUploaded(
|
|
144
144
|
ctx: MediaCtx,
|
|
@@ -172,7 +172,7 @@ export interface FileCatalogue {
|
|
|
172
172
|
restore(ctx: MediaCtx, id: string): Promise<void>;
|
|
173
173
|
/** Ingest file(s) from a LOCAL path already on this host's disk (a directory imports every
|
|
174
174
|
* regular file inside it, recursively; a file imports just itself). Each imported file is
|
|
175
|
-
* tagged with its immediate containing folder name (the
|
|
175
|
+
* tagged with its immediate containing folder name (the catalog is flat — folder structure
|
|
176
176
|
* survives as a tag, not a tree) plus any `tags` passed. Unreadable/unsupported entries are
|
|
177
177
|
* skipped, not thrown — the return value reports both. */
|
|
178
178
|
importFromPath(
|
|
@@ -23,7 +23,7 @@ export {
|
|
|
23
23
|
createBinaryServerProcessing,
|
|
24
24
|
} from './binaryServerProcessing.js';
|
|
25
25
|
// The transcode API as a plain job client, for apps whose binaries do NOT live in the file
|
|
26
|
-
//
|
|
26
|
+
// catalog (apps/notes keys attachments by sha256). One derivative pipeline, two doors.
|
|
27
27
|
export {
|
|
28
28
|
createTranscodeJobClient,
|
|
29
29
|
type TranscodeJobClient,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// fork the whole transcode orchestrator onto a second store type, the asset
|
|
8
8
|
// `transcode` handler wraps its `ObjectStore` in this adapter and reuses the
|
|
9
9
|
// pipeline unchanged. There is deliberately NO `localPath`, so `processVideo`
|
|
10
|
-
//
|
|
10
|
+
// materializes the source by download — correct for a stream store where the
|
|
11
11
|
// bytes may live off-box (S3/R2).
|
|
12
12
|
|
|
13
13
|
import type { ObjectStore } from 'cwip/storage';
|
|
@@ -85,7 +85,7 @@ export class SourceRegistry {
|
|
|
85
85
|
|
|
86
86
|
// ── Disk-backed source ──────────────────────────────────────────────────────────
|
|
87
87
|
// A MediaSource over a MediaStore: ingests uploads, runs the pipeline in the background, and
|
|
88
|
-
// resolves videos to
|
|
88
|
+
// resolves videos to tokenized PlayableVideos. Metadata is held in memory keyed by tenant (an
|
|
89
89
|
// app that needs persistence swaps this for a DB-backed MediaSource — cursedbelt-server/sqlite
|
|
90
90
|
// — without touching consumers).
|
|
91
91
|
type VideoMeta = {
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
//
|
|
4
4
|
// It was already here, inlined inside `createBinaryServerProcessing`, but only reachable
|
|
5
5
|
// through that module's two seams (`VideoProcessor` / `ImageDerivatives`), which are shaped
|
|
6
|
-
// for the cursedbelt file
|
|
7
|
-
//
|
|
8
|
-
// sha256 through satellite-kit's binary-store and has no
|
|
9
|
-
// the pipeline without either adopting the
|
|
6
|
+
// for the cursedbelt file CATALOG: they take a `MediaStore`, a `workDir`, an owner and a
|
|
7
|
+
// catalog id. An app that stores binaries some other way — apps/notes keys attachments by
|
|
8
|
+
// sha256 through satellite-kit's binary-store and has no catalog at all — could not reach
|
|
9
|
+
// the pipeline without either adopting the catalog or writing a second HTTP client.
|
|
10
10
|
//
|
|
11
|
-
// So the transport lives here and the
|
|
11
|
+
// So the transport lives here and the catalog seams are built on top of it. There is ONE
|
|
12
12
|
// derivative pipeline in the fleet, and this is its entry point.
|
|
13
13
|
//
|
|
14
14
|
// ── Why binary-server rather than deriving locally ──────────────────────────────────────
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// no packages resolvable at all and fails if it throws, so an `import` here that survives
|
|
12
12
|
// transpilation (anything that is not `import type`) turns that spec red rather than turning
|
|
13
13
|
// up in a consumer's install. The subpath exists because `./server/storage`'s own index is a
|
|
14
|
-
// barrel: it reaches `streamToken` → `auth/jwt` → jose, the whole SQLite file
|
|
14
|
+
// barrel: it reaches `streamToken` → `auth/jwt` → jose, the whole SQLite file catalog under
|
|
15
15
|
// `files/`, and a lazily-imported `sharp` — while an app that wants only the SHAPE of a file
|
|
16
16
|
// token (apps/collections wanted exactly `FileTokenClaims`, a type TypeScript erases) was made
|
|
17
17
|
// to install a one-time-password library to get it. Add types here freely; add a value import
|
|
@@ -203,7 +203,7 @@ export interface PhotoSource {
|
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
/** A source of MIXED media (photos + videos) for a combined gallery — the union of
|
|
206
|
-
* {@link MediaSource} and {@link PhotoSource} over ONE
|
|
206
|
+
* {@link MediaSource} and {@link PhotoSource} over ONE catalog. `list`/`resolve`
|
|
207
207
|
* yield `GalleryMedia` (a `mediaKind`-tagged photo|video), and a `kind` filter narrows
|
|
208
208
|
* to just photos or just videos. Same cursor/tag/sort listing contract as its siblings. */
|
|
209
209
|
export interface MediaGallerySource {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* one key's worth of write access for a bounded time.
|
|
4
4
|
*
|
|
5
5
|
* Each case below is a claim binary-server ENFORCES, so a mint that got it wrong would not be
|
|
6
|
-
* caught downstream — it would be
|
|
6
|
+
* caught downstream — it would be honored: a token for the wrong key writes the wrong key, a
|
|
7
7
|
* token with no expiry writes for ever, and a token with no `sz` stores a short object `active`.
|
|
8
8
|
*/
|
|
9
9
|
import { describe, expect, it } from 'bun:test';
|
|
@@ -46,12 +46,12 @@ describe('video derivative keys', () => {
|
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
describe('isDerivativeKey', () => {
|
|
49
|
-
it('
|
|
49
|
+
it('recognizes every suffix it publishes', () => {
|
|
50
50
|
for (const suffix of DERIVATIVE_SUFFIXES)
|
|
51
51
|
expect(isDerivativeKey(`${key}${suffix}`)).toBe(true);
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
it('🔴
|
|
54
|
+
it('🔴 recognizes objects INSIDE an HLS tree, which carry no derivative suffix', () => {
|
|
55
55
|
// Miss these and the sweep treats a segment as a video needing a remux, then derives
|
|
56
56
|
// from that, forever. None of them ends in a name from DERIVATIVE_SUFFIXES.
|
|
57
57
|
expect(isDerivativeKey(`${key}.hls/master.m3u8`)).toBe(true);
|
|
@@ -102,7 +102,7 @@ describe("the encoder generation in a video derivative's name", () => {
|
|
|
102
102
|
expect(hlsMasterKeyFor("v/clip.mov", 2)).toBe("v/clip.mov.g2.hls/master.m3u8");
|
|
103
103
|
});
|
|
104
104
|
|
|
105
|
-
it("🔴 a tagged derivative is still
|
|
105
|
+
it("🔴 a tagged derivative is still recognized as a derivative", () => {
|
|
106
106
|
// Miss this and a sweep treats clip.g2.web.mp4 as a source and derives from it for ever.
|
|
107
107
|
expect(isDerivativeKey("v/clip.mov.g2.web.mp4")).toBe(true);
|
|
108
108
|
expect(isDerivativeKey("v/clip.mov.g2.hls/720/000.ts")).toBe(true);
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* FileCatalogue: a caller that holds an owner and an item id, whose derivatives live in their
|
|
27
27
|
* own top-level namespaces. This module addresses a caller that holds a binary-server KEY and
|
|
28
28
|
* derives sibling names from it, which is what makes "ask /meta for a name you computed" work
|
|
29
|
-
* with no
|
|
29
|
+
* with no catalog at all.
|
|
30
30
|
*
|
|
31
31
|
* Two consumers, two shapes, both correct:
|
|
32
32
|
* · `fs*` — cursedbelt's own FileCatalogue / the `library` transcode strategy.
|
|
@@ -133,7 +133,7 @@ export async function processVideo(opts: ProcessOptions): Promise<ProcessResult>
|
|
|
133
133
|
try {
|
|
134
134
|
report('processing', 1);
|
|
135
135
|
|
|
136
|
-
// 1.
|
|
136
|
+
// 1. Materialize the source locally for ffmpeg (use the backend's own path if local).
|
|
137
137
|
let srcPath = (await store.localPath?.(sourceKey)) ?? null;
|
|
138
138
|
if (!srcPath) {
|
|
139
139
|
const bytes = await store.get(sourceKey);
|
|
@@ -59,7 +59,7 @@ export interface SyncStatusReporter {
|
|
|
59
59
|
* a claim about failures that did not happen. But "a peer authenticated here" is
|
|
60
60
|
* something that happened to the database, and forgetting it produced the owner's
|
|
61
61
|
* 2026-08-16 report — prod saying *"Awaiting first sync"* over a vault he had used
|
|
62
|
-
* for weeks. The badge's own words are "your Mac has not
|
|
62
|
+
* for weeks. The badge's own words are "your Mac has not dialed since this server
|
|
63
63
|
* last restarted", which is true and which nobody reads as anything but "this has
|
|
64
64
|
* never synced". A receiver restarts on every deploy, and the dialer runs every 5
|
|
65
65
|
* minutes only while the Mac is awake — so the window in which a perfectly converged
|
|
@@ -91,7 +91,7 @@ describe("sync timer", () => {
|
|
|
91
91
|
});
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
|
-
* 🔴 The check this whole change exists for, measured as
|
|
94
|
+
* 🔴 The check this whole change exists for, measured as BEHAVIOR rather than
|
|
95
95
|
* shape. Whatever mechanism a future edit reaches for — a `setInterval`, a
|
|
96
96
|
* re-added `intervalMs`, an injected `checkRequest` dep, a recursive `schedule`
|
|
97
97
|
* — it has to book a callback through `setTimer` to fire, and this asserts that
|
|
@@ -113,7 +113,7 @@ describe("the Bun.password shim", () => {
|
|
|
113
113
|
expect(await Bun.password.verify(PASSWORD, hash)).toBe(true);
|
|
114
114
|
});
|
|
115
115
|
|
|
116
|
-
it("
|
|
116
|
+
it("honors the STORED cost parameters, not its own defaults", async () => {
|
|
117
117
|
const cheap = await Bun.password.hash(PASSWORD, { algorithm: "argon2id", memoryCost: 4096, timeCost: 1 });
|
|
118
118
|
expect(parsePhc(cheap)?.m).toBe(4096);
|
|
119
119
|
expect(await workerPassword.verify(PASSWORD, cheap)).toBe(true);
|
|
@@ -13,7 +13,7 @@ import { Crc32, dosDateTime, safeEntryName, type ZipEntry, zipStream } from './z
|
|
|
13
13
|
|
|
14
14
|
const bytesOf = (text: string): Uint8Array => new TextEncoder().encode(text);
|
|
15
15
|
|
|
16
|
-
/** The report entry a skipped member lands in —
|
|
16
|
+
/** The report entry a skipped member lands in — spelled out, since a person reads it by this name. */
|
|
17
17
|
const MISSING_FILES_NAME = "MISSING FILES.txt";
|
|
18
18
|
|
|
19
19
|
const entryFrom = (name: string, body: string): ZipEntry => ({
|
|
@@ -160,7 +160,7 @@ describe("zipStream", () => {
|
|
|
160
160
|
expect(await unzipRead(archive, "f/todo (2).md")).toBe("lower");
|
|
161
161
|
});
|
|
162
162
|
|
|
163
|
-
test("🔴 one name
|
|
163
|
+
test("🔴 one name spelled with a composed and a decomposed accent is ONE name to APFS — numbered too", async () => {
|
|
164
164
|
const composed = "Caf\u00e9.txt";
|
|
165
165
|
const decomposed = "Cafe\u0301.txt";
|
|
166
166
|
expect(composed).not.toBe(decomposed);
|
package/src/server/zipStream.ts
CHANGED
|
@@ -227,7 +227,7 @@ function asStream(body: ReadableStream<Uint8Array> | Uint8Array): ReadableStream
|
|
|
227
227
|
* want `Notes/Summary.md` produce `Summary.md` and `Summary (2).md`, because a zip with two
|
|
228
228
|
* identical names extracts as one file, silently losing the other. A duplicate FOLDER is written
|
|
229
229
|
* once: its files already land in it. Names are compared the way the person's disk will compare
|
|
230
|
-
* them — case-folded and Unicode-
|
|
230
|
+
* them — case-folded and Unicode-normalized, since macOS and Windows both treat `Todo.md` and
|
|
231
231
|
* `todo.md` as ONE file — so the later one is numbered rather than overwriting the first on unzip.
|
|
232
232
|
*
|
|
233
233
|
* A member that cannot be read (its `open()` returns `null` or throws, or the caller yielded it
|
|
@@ -53,8 +53,8 @@ describe('every file inside the published surface is tracked', () => {
|
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
test('no untracked file sits inside a directory `files` ships', async () => {
|
|
56
|
-
// --others = untracked; --exclude-standard
|
|
57
|
-
// ignored paths (.agent.noindex, node_modules) are not
|
|
56
|
+
// --others = untracked; --exclude-standard honors .gitignore, so deliberately
|
|
57
|
+
// ignored paths (.agent.noindex, node_modules) are not offenses.
|
|
58
58
|
const { ok, out } = await git('ls-files', '--others', '--exclude-standard', '--', ...shippedDirs());
|
|
59
59
|
expect(ok, 'git ls-files failed').toBe(true);
|
|
60
60
|
const untracked = out === '' ? [] : out.split('\n');
|