sliftutils 1.7.37 → 1.7.39

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 (64) hide show
  1. package/allowclient.flag +0 -0
  2. package/electron/electronRenderer.tsx +2 -0
  3. package/examplestorage/browser.tsx +1 -1
  4. package/index.d.ts +0 -1
  5. package/misc/apiKeys.tsx +2 -0
  6. package/misc/dist/getSecret.ts.cache +2 -2
  7. package/misc/dist/strings.ts.cache +3 -4
  8. package/misc/https/certs.ts +0 -2
  9. package/misc/https/dist/certs.ts.cache +3 -4
  10. package/misc/https/dist/hostServer.ts.cache +49 -3
  11. package/misc/https/dist/httpsCerts.ts.cache +5 -11
  12. package/misc/https/dist/persistentLocalStorage.ts.cache +3 -4
  13. package/misc/https/persistentLocalStorage.ts +0 -2
  14. package/misc/strings.ts +0 -2
  15. package/package.json +1 -1
  16. package/render-utils/DropdownCustom.tsx +2 -0
  17. package/render-utils/FullscreenModal.tsx +2 -0
  18. package/render-utils/Input.tsx +0 -2
  19. package/render-utils/InputLabel.tsx +1 -1
  20. package/render-utils/InputPicker.tsx +2 -0
  21. package/render-utils/LocalStorageParam.ts +2 -0
  22. package/render-utils/SyncedController.ts +2 -0
  23. package/render-utils/Table.tsx +2 -0
  24. package/render-utils/URLParam.ts +2 -0
  25. package/render-utils/asyncObservable.ts +2 -0
  26. package/render-utils/colors.tsx +0 -2
  27. package/render-utils/dist/observer.tsx.cache +3 -3
  28. package/render-utils/mobxTyped.ts +2 -0
  29. package/render-utils/modal.tsx +2 -0
  30. package/render-utils/observer.tsx +1 -1
  31. package/storage/FileFolderAPI.tsx +2 -0
  32. package/storage/IArchives.ts +0 -2
  33. package/storage/PendingManager.tsx +2 -0
  34. package/storage/StorageObservable.ts +2 -0
  35. package/storage/dist/FileFolderAPI.tsx.cache +3 -2
  36. package/storage/dist/IArchives.ts.cache +4 -5
  37. package/storage/dist/PendingManager.tsx.cache +3 -2
  38. package/storage/dist/backblaze.ts.cache +2 -2
  39. package/storage/remoteStorage/ArchivesRemote.ts +0 -2
  40. package/storage/remoteStorage/ArchivesUrl.ts +0 -2
  41. package/storage/remoteStorage/accessPage.tsx +1 -1
  42. package/storage/remoteStorage/createArchives.ts +0 -2
  43. package/storage/remoteStorage/dist/ArchivesRemote.ts.cache +2 -3
  44. package/storage/remoteStorage/dist/ArchivesUrl.ts.cache +2 -3
  45. package/storage/remoteStorage/dist/accessPage.tsx.cache +4 -8
  46. package/storage/remoteStorage/dist/createArchives.ts.cache +2 -3
  47. package/storage/remoteStorage/dist/productionEnv.ts.cache +5 -0
  48. package/storage/remoteStorage/dist/remoteConfig.ts.cache +2 -3
  49. package/storage/remoteStorage/dist/sourceWrapper.ts.cache +2 -3
  50. package/storage/remoteStorage/dist/storageController.ts.cache +2 -3
  51. package/storage/remoteStorage/dist/storageServer.ts.cache +31 -18
  52. package/storage/remoteStorage/dist/storageServerCli.ts.cache +2 -3
  53. package/storage/remoteStorage/dist/storageServerState.ts.cache +10 -2
  54. package/storage/remoteStorage/remoteConfig.ts +0 -2
  55. package/storage/remoteStorage/sourceWrapper.ts +0 -2
  56. package/storage/remoteStorage/storageController.ts +0 -2
  57. package/storage/remoteStorage/storageServer.d.ts +0 -1
  58. package/storage/remoteStorage/storageServer.ts +2 -2
  59. package/storage/remoteStorage/storageServerState.ts +8 -0
  60. package/testsite/browser.tsx +1 -1
  61. package/testsite/serverInfoController.ts +0 -2
  62. package/web/ExamplePage.tsx +2 -0
  63. package/web/browser.tsx +2 -0
  64. package/storage/remoteStorage/productionEnv.ts +0 -2
@@ -1,5 +1,3 @@
1
- module.allowclient = true;
2
-
3
1
  import { sort, sha256HashBuffer } from "socket-function/src/misc";
4
2
  import { getBufferInt } from "socket-function/src/bits";
5
3
  import { RemoteConfig, RemoteConfigBase, HostedConfig, BackblazeConfig, FULL_VALID_WINDOW, FULL_ROUTE, VARIABLE_SHARD } from "../IArchives";
@@ -1,5 +1,3 @@
1
- module.allowclient = true;
2
-
3
1
  import { isNode, sort } from "socket-function/src/misc";
4
2
  import { delay } from "socket-function/src/batching";
5
3
  import { getSecret } from "../../misc/getSecret";
@@ -1,5 +1,3 @@
1
- module.allowclient = true;
2
-
3
1
  import { SocketFunction } from "socket-function/SocketFunction";
4
2
  import { SocketFunctionHook } from "socket-function/SocketFunctionTypes";
5
3
  import { getNodeIdIP } from "socket-function/src/nodeCache";
@@ -1,4 +1,3 @@
1
- import "./productionEnv";
2
1
  import "./accessPage";
3
2
  export type HostStorageServerConfig = {
4
3
  url: string;
@@ -1,5 +1,5 @@
1
- // Must stay the FIRST import: it sets NODE_ENV, which decides which build of mobx (and anything else that switches on it) the imports below load
2
- import "./productionEnv";
1
+ process.env.NODE_ENV = "production";
2
+
3
3
  import os from "os";
4
4
  import path from "path";
5
5
  import fsp from "fs/promises";
@@ -508,6 +508,10 @@ function buildBucket(account: string, bucketName: string, routing: RemoteConfig,
508
508
  let loaded: LoadedBucket = { account, bucketName, routing, routingJSON: JSON.stringify(routing), selfEntries, self, store, structureKey: plan.structureKey };
509
509
  scheduleWindowBoundaryRebuild(loaded);
510
510
  scheduleBoundaryScans(loaded);
511
+ // A loaded bucket must actually be running: the store's init loads its index and starts its source synchronization, and it is lazy, so without this a bucket nothing has read from or written to sits inert - reporting no data and no syncing while its disk is full of files.
512
+ if (store instanceof BlobStore) {
513
+ void store.init().catch((e: Error) => console.error(`Initializing the store for bucket ${account}/${bucketName} failed: ${e.stack ?? e}`));
514
+ }
511
515
  return loaded;
512
516
  }
513
517
 
@@ -870,6 +874,10 @@ export async function activateBucket(account: string, bucketName: string): Promi
870
874
  if (!loaded) {
871
875
  return `Bucket ${key} does not exist on this server (no routing file in ${getBucketFolder(account, bucketName)})`;
872
876
  }
877
+ // Wait for the index to load, so the totals we return are the real ones rather than zeroes from a store that has not read its index yet. The source scans keep running in the background.
878
+ if (loaded.store instanceof BlobStore) {
879
+ await loaded.store.init();
880
+ }
873
881
  if (!wasLoaded) {
874
882
  console.log(`Activated bucket ${key} on request: it is now loaded and synchronizing`);
875
883
  }
@@ -1,4 +1,4 @@
1
- module.allowclient = true;
1
+ process.env.NODE_ENV = "production";
2
2
 
3
3
  import preact from "preact";
4
4
  import { observable } from "mobx";
@@ -1,5 +1,3 @@
1
- module.allowclient = true;
2
-
3
1
  import os from "os";
4
2
  import { SocketFunction } from "socket-function/SocketFunction";
5
3
 
@@ -1,3 +1,5 @@
1
+ process.env.NODE_ENV = "production";
2
+
1
3
  import { observable } from "mobx";
2
4
  import { list } from "socket-function/src/misc";
3
5
  import { css } from "typesafecss";
package/web/browser.tsx CHANGED
@@ -1,3 +1,5 @@
1
+ process.env.NODE_ENV = "production";
2
+
1
3
  import * as preact from "preact";
2
4
  import { observable } from "mobx";
3
5
  import { observer } from "../render-utils/observer";
@@ -1,2 +0,0 @@
1
- // Packages like mobx pick which build to require at runtime, from process.env.NODE_ENV. The browser require shim runs as production, so a server that loads the development build ships a module graph the client cannot satisfy ("Accessed unexpected module ./mobx.cjs.production.min.js ... Expected imports: ./mobx.cjs.development.js"). Setting this is the only way to make both sides agree, and it MUST happen before anything imports such a package - which is why it lives in its own module, imported first (import statements run in source order, so a plain statement at the top of storageServer.ts would run too late).
2
- process.env.NODE_ENV = "production";