core-3nweb-client-lib 0.41.11 → 0.41.13

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 (28) hide show
  1. package/build/core/asmail/inbox/inbox-events.js +2 -2
  2. package/build/core/storage/synced/remote-events.js +2 -2
  3. package/build/lib-client/3nstorage/storage-owner.d.ts +2 -1
  4. package/build/lib-client/3nstorage/storage-owner.js +2 -2
  5. package/build/lib-client/asmail/recipient.d.ts +2 -1
  6. package/build/lib-client/asmail/recipient.js +2 -2
  7. package/build/lib-client/cryptor/cryptor-wasm.js +1 -1
  8. package/build/lib-client/cryptor/cryptor.wasm +0 -0
  9. package/build/lib-client/server-events.js +7 -2
  10. package/build/lib-common/ipc/generic-ipc.js +2 -0
  11. package/build/lib-common/ipc/ws-ipc.d.ts +2 -1
  12. package/build/lib-common/ipc/ws-ipc.js +53 -11
  13. package/build/lib-index.d.ts +6 -2
  14. package/build/lib-index.js +16 -7
  15. package/package.json +1 -1
  16. package/test-data-1-1759442588983/util/logs/2025-10-02.log.txt +6 -0
  17. package/test-data-10-1759442625007/util/logs/2025-10-02.log.txt +11 -0
  18. package/test-data-11-1759442625008/util/logs/2025-10-02.log.txt +6 -0
  19. package/test-data-12-1759442628713/util/logs/2025-10-02.log.txt +6 -0
  20. package/test-data-13-1759442629512/util/logs/2025-10-02.log.txt +11 -0
  21. package/test-data-2-1759442588985/util/logs/2025-10-02.log.txt +6 -0
  22. package/test-data-3-1759442593521/util/logs/2025-10-02.log.txt +11 -0
  23. package/test-data-4-1759442599428/util/logs/2025-10-02.log.txt +11 -0
  24. package/test-data-5-1759442608549/util/logs/2025-10-02.log.txt +6 -0
  25. package/test-data-6-1759442610426/util/logs/2025-10-02.log.txt +6 -0
  26. package/test-data-7-1759442612369/util/logs/2025-10-02.log.txt +6 -0
  27. package/test-data-8-1759442620927/util/logs/2025-10-02.log.txt +6 -0
  28. package/test-data-9-1759442621732/util/logs/2025-10-02.log.txt +11 -0
@@ -20,7 +20,7 @@ const retrieval_1 = require("../../../lib-common/service-api/asmail/retrieval");
20
20
  const server_events_1 = require("../../../lib-client/server-events");
21
21
  const operators_1 = require("rxjs/operators");
22
22
  const utils_for_observables_1 = require("../../../lib-common/utils-for-observables");
23
- const SERVER_EVENTS_RESTART_WAIT_SECS = 30;
23
+ const SERVER_EVENTS_RESTART_WAIT_SECS = 5;
24
24
  /**
25
25
  * Instance of this class handles event subscription from UI side. It observes
26
26
  * inbox server events, handles them, and generates respective events for UI
@@ -33,7 +33,7 @@ const SERVER_EVENTS_RESTART_WAIT_SECS = 30;
33
33
  */
34
34
  class InboxEvents {
35
35
  constructor(msgReceiver, getMsg, logError) {
36
- const serverEvents = new server_events_1.ServerEvents(() => msgReceiver.openEventSource(), SERVER_EVENTS_RESTART_WAIT_SECS, logError);
36
+ const serverEvents = new server_events_1.ServerEvents(() => msgReceiver.openEventSource(logError), SERVER_EVENTS_RESTART_WAIT_SECS, logError);
37
37
  this.newMsg$ = serverEvents.observe(retrieval_1.msgRecievedCompletely.EVENT_NAME)
38
38
  .pipe(
39
39
  // XXX tap to log more details
@@ -21,7 +21,7 @@ const rxjs_1 = require("rxjs");
21
21
  const server_events_1 = require("../../../lib-client/server-events");
22
22
  const owner_1 = require("../../../lib-common/service-api/3nstorage/owner");
23
23
  const operators_1 = require("rxjs/operators");
24
- const SERVER_EVENTS_RESTART_WAIT_SECS = 30;
24
+ const SERVER_EVENTS_RESTART_WAIT_SECS = 5;
25
25
  /**
26
26
  * Remote events are absorbed into objects' statuses, broadcasting respective
27
27
  * events. Someone down the stream can react to these changes from remote.
@@ -36,7 +36,7 @@ class RemoteEvents {
36
36
  Object.seal(this);
37
37
  }
38
38
  startAbsorbingRemoteEvents() {
39
- const serverEvents = new server_events_1.ServerEvents(() => this.remoteStorage.openEventSource(), SERVER_EVENTS_RESTART_WAIT_SECS, this.logError);
39
+ const serverEvents = new server_events_1.ServerEvents(() => this.remoteStorage.openEventSource(this.logError), SERVER_EVENTS_RESTART_WAIT_SECS, this.logError);
40
40
  this.absorbingRemoteEventsProc = (0, rxjs_1.merge)(this.absorbObjChange(serverEvents), this.absorbObjRemoval(serverEvents), this.absorbObjVersionArchival(serverEvents), this.absorbArchVersionRemoval(serverEvents))
41
41
  .subscribe({
42
42
  next: noop,
@@ -4,6 +4,7 @@ import { ServiceUser, IGetMailerIdSigner } from '../user-with-mid-session';
4
4
  import * as keyGen from '../key-derivation';
5
5
  import { SubscribingClient } from '../../lib-common/ipc/ws-ipc';
6
6
  import { ObjId } from '../xsp-fs/common';
7
+ import { LogError } from '../logging/log-to-file';
7
8
  export type FirstSaveReqOpts = api.PutObjFirstQueryOpts;
8
9
  export type FollowingSaveReqOpts = api.PutObjSecondQueryOpts;
9
10
  export declare class StorageOwner extends ServiceUser {
@@ -86,5 +87,5 @@ export declare class StorageOwner extends ServiceUser {
86
87
  * @return a promise, resolvable, when an object is deleted.
87
88
  */
88
89
  deleteObj(objId: string): Promise<void>;
89
- openEventSource(): Promise<SubscribingClient>;
90
+ openEventSource(log: LogError): Promise<SubscribingClient>;
90
91
  }
@@ -329,10 +329,10 @@ class StorageOwner extends user_with_mid_session_1.ServiceUser {
329
329
  throw (0, request_utils_1.makeException)(rep, 'Unexpected status');
330
330
  }
331
331
  }
332
- async openEventSource() {
332
+ async openEventSource(log) {
333
333
  const rep = await this.openWS(api.wsEventChannel.URL_END);
334
334
  if (rep.status === api.wsEventChannel.SC.ok) {
335
- return (0, ws_ipc_1.makeSubscriber)(rep.data, undefined);
335
+ return (0, ws_ipc_1.makeSubscriber)(rep.data, undefined, log);
336
336
  }
337
337
  else {
338
338
  throw (0, request_utils_1.makeException)(rep, 'Unexpected status');
@@ -2,6 +2,7 @@ import { NetClient } from '../request-utils';
2
2
  import * as api from '../../lib-common/service-api/asmail/retrieval';
3
3
  import { ServiceUser, IGetMailerIdSigner } from '../user-with-mid-session';
4
4
  import { SubscribingClient } from '../../lib-common/ipc/ws-ipc';
5
+ import { LogError } from '../logging/log-to-file';
5
6
  type InboxException = web3n.asmail.InboxException;
6
7
  export declare function makeMsgNotFoundException(msgId: string): InboxException;
7
8
  export declare function makeObjNotFoundException(msgId: string, objId: string): InboxException;
@@ -36,6 +37,6 @@ export declare class MailRecipient extends ServiceUser {
36
37
  */
37
38
  getObjSegs(msgId: string, objId: string, start: number, end: number): Promise<Uint8Array>;
38
39
  removeMsg(msgId: string): Promise<void>;
39
- openEventSource(): Promise<SubscribingClient>;
40
+ openEventSource(log: LogError): Promise<SubscribingClient>;
40
41
  }
41
42
  export {};
@@ -192,10 +192,10 @@ class MailRecipient extends user_with_mid_session_1.ServiceUser {
192
192
  throw (0, request_utils_1.makeException)(rep, 'Unexpected status');
193
193
  }
194
194
  }
195
- async openEventSource() {
195
+ async openEventSource(log) {
196
196
  const rep = await this.openWS(api.wsEventChannel.URL_END);
197
197
  if (rep.status === api.wsEventChannel.SC.ok) {
198
- return (0, ws_ipc_1.makeSubscriber)(rep.data, undefined);
198
+ return (0, ws_ipc_1.makeSubscriber)(rep.data, undefined, log);
199
199
  }
200
200
  else {
201
201
  throw (0, request_utils_1.makeException)(rep, 'Unexpected status');