sliftutils 1.7.115 → 1.7.117

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.
Files changed (33) hide show
  1. package/index.d.ts +12 -5
  2. package/package.json +2 -2
  3. package/spec.txt +4 -5
  4. package/storage/ArchivesDisk.ts +8 -8
  5. package/storage/IArchives.d.ts +6 -2
  6. package/storage/IArchives.ts +7 -3
  7. package/storage/TransactionFile.d.ts +1 -1
  8. package/storage/TransactionFile.ts +11 -11
  9. package/storage/archiveHelpers.d.ts +3 -1
  10. package/storage/archiveHelpers.ts +19 -14
  11. package/storage/dist/ArchivesDisk.ts.cache +10 -10
  12. package/storage/dist/IArchives.ts.cache +2 -2
  13. package/storage/dist/TransactionFile.ts.cache +13 -13
  14. package/storage/dist/archiveHelpers.ts.cache +19 -16
  15. package/storage/remoteStorage/ArchivesDelayed.ts +1 -1
  16. package/storage/remoteStorage/ArchivesRemote.ts +2 -2
  17. package/storage/remoteStorage/blobStore.d.ts +1 -1
  18. package/storage/remoteStorage/blobStore.ts +15 -9
  19. package/storage/remoteStorage/bucketDisk.ts +2 -2
  20. package/storage/remoteStorage/chainStartup.ts +1 -1
  21. package/storage/remoteStorage/createArchives.ts +1 -1
  22. package/storage/remoteStorage/dist/ArchivesDelayed.ts.cache +3 -3
  23. package/storage/remoteStorage/dist/ArchivesRemote.ts.cache +4 -4
  24. package/storage/remoteStorage/dist/blobStore.ts.cache +20 -11
  25. package/storage/remoteStorage/dist/bucketDisk.ts.cache +4 -4
  26. package/storage/remoteStorage/dist/chainStartup.ts.cache +3 -3
  27. package/storage/remoteStorage/dist/createArchives.ts.cache +3 -3
  28. package/storage/remoteStorage/dist/storageController.ts.cache +2 -2
  29. package/storage/remoteStorage/dist/storeSync.ts.cache +8 -8
  30. package/storage/remoteStorage/storageController.d.ts +1 -0
  31. package/storage/remoteStorage/storageController.ts +1 -1
  32. package/storage/remoteStorage/storeSync.ts +6 -6
  33. package/yarn.lock +4 -4
@@ -139,6 +139,7 @@ export declare const RemoteStorageController: import("socket-function/SocketFunc
139
139
  sourceConfig: SourceConfig;
140
140
  time: number;
141
141
  routes?: [number, number][];
142
+ internal?: boolean;
142
143
  }) => Promise<ArchiveFileInfo[]>;
143
144
  getArchivesConfig: (config: {
144
145
  account: string;
@@ -336,7 +336,7 @@ class RemoteStorageControllerBase {
336
336
  }
337
337
  @assertValidArgs
338
338
  @trackAccessCall("getChangesAfter")
339
- async getChangesAfter2(config: { account: string; bucketName: string; sourceConfig: SourceConfig; time: number; routes?: [number, number][] }): Promise<ArchiveFileInfo[]> {
339
+ async getChangesAfter2(config: { account: string; bucketName: string; sourceConfig: SourceConfig; time: number; routes?: [number, number][]; internal?: boolean }): Promise<ArchiveFileInfo[]> {
340
340
  return await withStore(config, store => store.getChangesAfter2(config));
341
341
  }
342
342
  @assertValidArgs
@@ -240,7 +240,7 @@ export class StoreSync {
240
240
  public async boundaryScanRemote(source: IArchives, config: { since: number; route?: [number, number] }): Promise<void> {
241
241
  let scanStart = Date.now();
242
242
  logSyncEvent({ event: "boundaryScanStart", store: this.store.folder, source: source.getDebugName(), since: config.since, route: config.route || FULL_ROUTE });
243
- let changes = await source.getChangesAfter2({ time: config.since, routes: config.route && [config.route] || undefined });
243
+ let changes = await source.getChangesAfter2({ time: config.since, routes: config.route && [config.route] || undefined, internal: true });
244
244
  let tally = newScanTally();
245
245
  for (let file of changes) {
246
246
  if (file.path === ROUTING_FILE) {
@@ -258,7 +258,7 @@ export class StoreSync {
258
258
  tally.tombstone++;
259
259
  continue;
260
260
  }
261
- let copied = await copyArchiveFile({ from: source, to: this.store.sources[0].source, path: file.path, forceSetImmutable: true, noChecks: true, internal: true });
261
+ let copied = await copyArchiveFile({ from: source, to: this.store.sources[0].source, path: file.path, preserveWriteTime: true, forceSetImmutable: true, noChecks: true, internal: true });
262
262
  if (!copied) {
263
263
  // Undefined is two cases (see copyArchiveFile): our own disk already holding something newer is the boundary scan working as intended (our writes since the boundary outrank the neighbor's), only a genuinely unreadable file is worth a warning
264
264
  let local = await this.store.sources[0].source.getInfo(file.path);
@@ -387,7 +387,7 @@ export class StoreSync {
387
387
  try {
388
388
  let attempts = 0;
389
389
  while (true) {
390
- files = await source.findInfo("");
390
+ files = await source.findInfo("", { internal: true });
391
391
  if (this.store.stopped.stop || state.stopped.stop) break;
392
392
  // What we believe the source has: whichever is larger of its previous listing and the index entries naming it as holder. Files do not just vanish - a listing far below this means the other end is briefly broken, and believing it would purge everything it held.
393
393
  let held = 0;
@@ -494,7 +494,7 @@ export class StoreSync {
494
494
  }
495
495
  let holder = await this.store.getEntryHolder(entry);
496
496
  if (!holder) continue;
497
- let copied = await copyArchiveFile({ from: holder, to: source, path: key, forceSetImmutable: true, noChecks: true, internal: true });
497
+ let copied = await copyArchiveFile({ from: holder, to: source, path: key, preserveWriteTime: true, forceSetImmutable: true, noChecks: true, internal: true });
498
498
  if (!copied) {
499
499
  // Undefined is two cases (see copyArchiveFile). The source having a NEWER file than our index (the listing we pushed from was stale) is adopted exactly the way the pull direction adopts a listing entry - and pushing our stale copy stops. Otherwise the HOLDER could not produce the file, which the next round's pull re-resolves; either way, silence here was the bug.
500
500
  let theirs = await source.getInfo(key);
@@ -557,7 +557,7 @@ export class StoreSync {
557
557
  let { source, route } = this.store.sources[sourceIndex];
558
558
  let state = this.states[sourceIndex];
559
559
  let pollStart = Date.now();
560
- let changes = await source.getChangesAfter2({ time: state.changesAfterTime, routes: route && [route] || undefined });
560
+ let changes = await source.getChangesAfter2({ time: state.changesAfterTime, routes: route && [route] || undefined, internal: true });
561
561
  let tally = newScanTally();
562
562
  for (let file of changes) {
563
563
  tally[this.updateScanIndex(sourceIndex, file)]++;
@@ -648,7 +648,7 @@ export class StoreSync {
648
648
  if (index >= pending.length) return;
649
649
  let { key, entry } = pending[index];
650
650
  try {
651
- let copied = await copyArchiveFile({ from: source, to: this.store.sources[0].source, path: key, forceSetImmutable: true, noChecks: true, internal: true });
651
+ let copied = await copyArchiveFile({ from: source, to: this.store.sources[0].source, path: key, preserveWriteTime: true, forceSetImmutable: true, noChecks: true, internal: true });
652
652
  if (copied) {
653
653
  copiedFiles++;
654
654
  copiedBytes += copied.size;
package/yarn.lock CHANGED
@@ -1937,10 +1937,10 @@ slash@^3.0.0:
1937
1937
  resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
1938
1938
  integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==
1939
1939
 
1940
- socket-function@^1.2.32:
1941
- version "1.2.32"
1942
- resolved "https://registry.yarnpkg.com/socket-function/-/socket-function-1.2.32.tgz#9cd6ff3daf2e365bfaef5da0f35271f1c9fd89d3"
1943
- integrity sha512-d/nuXNXnikLG1eefi099+pG0Lqeibk7Pv92k01YXfTy3W1QjXCef0B9/0hrNJoSyB96r8mtSGk0JdKhCNMqGVQ==
1940
+ socket-function@^1.2.33:
1941
+ version "1.2.33"
1942
+ resolved "https://registry.yarnpkg.com/socket-function/-/socket-function-1.2.33.tgz#9137a8cc81f586e6650f837097e44202ec5e071e"
1943
+ integrity sha512-kdbwUDCtBnjqdfvH0JgmJZujP3IeuofSg5OsF2IcWCQ9YDiUisd5ydBzwBbjOLomErOnJgj6dySBp3dlTSzQIw==
1944
1944
  dependencies:
1945
1945
  "@types/pako" "^2.0.3"
1946
1946
  "@types/ws" "^8.5.3"