@ibgib/core-gib 0.0.76 → 0.0.78
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/common/pubsub/observable/observable-base-v1.d.mts +1 -1
- package/dist/common/pubsub/subject/subject-v1.d.mts +1 -1
- package/dist/common/pubsub/subscription/subscription-v1.d.mts +1 -1
- package/dist/witness/app/app-base-v1.d.mts +1 -1
- package/dist/witness/keystone/keystone-base-v1.d.mts +1 -1
- package/dist/witness/robbot/robbot-base-v1.mjs +3 -3
- package/dist/witness/space/metaspace/metaspace-base.d.mts +6 -1
- package/dist/witness/space/metaspace/metaspace-base.d.mts.map +1 -1
- package/dist/witness/space/metaspace/metaspace-base.mjs +4 -3
- package/dist/witness/space/metaspace/metaspace-base.mjs.map +1 -1
- package/dist/witness/space/metaspace/metaspace-types.d.mts +5 -0
- package/dist/witness/space/metaspace/metaspace-types.d.mts.map +1 -1
- package/dist/witness/space/space-helper.d.mts +10 -1
- package/dist/witness/space/space-helper.d.mts.map +1 -1
- package/dist/witness/space/space-helper.mjs +2 -2
- package/dist/witness/space/space-helper.mjs.map +1 -1
- package/dist/witness/witness-with-context/witness-with-context-base-v1.d.mts +8 -8
- package/dist/witness/witness-with-context/witness-with-context-base-v1.mjs +51 -51
- package/package.json +1 -1
- package/src/common/pubsub/observable/observable-base-v1.mts +1 -1
- package/src/common/pubsub/subject/subject-v1.mts +1 -1
- package/src/common/pubsub/subscription/subscription-v1.mts +1 -1
- package/src/witness/app/app-base-v1.mts +1 -1
- package/src/witness/keystone/keystone-base-v1.mts +1 -1
- package/src/witness/robbot/robbot-base-v1.mts +2 -2
- package/src/witness/space/metaspace/metaspace-base.mts +13 -3
- package/src/witness/space/metaspace/metaspace-types.mts +5 -0
- package/src/witness/space/space-helper.mts +11 -1
- package/src/witness/witness-with-context/witness-with-context-base-v1.mts +47 -47
|
@@ -105,13 +105,13 @@ export class WitnessWithContextBase_V1 extends WitnessBase_V1 {
|
|
|
105
105
|
if (logalot) {
|
|
106
106
|
console.log(`${lc} starting... (I: 94755c3131f4dfa12d20fa38e2926522)`);
|
|
107
107
|
}
|
|
108
|
-
if (this.
|
|
108
|
+
if (this.metaspace) {
|
|
109
109
|
// check for newer version of self locally before executing
|
|
110
110
|
const thisAddr = getIbGibAddr({ ibGib: this });
|
|
111
|
-
const latestAddr = await this.
|
|
111
|
+
const latestAddr = await this.metaspace.getLatestAddr({ ibGib: this });
|
|
112
112
|
if (latestAddr && latestAddr !== thisAddr) {
|
|
113
113
|
// this has a newer ibgib in its timeline
|
|
114
|
-
let resGet = await this.
|
|
114
|
+
let resGet = await this.metaspace.get({ addr: latestAddr });
|
|
115
115
|
if (!resGet || !resGet?.success || (resGet?.ibGibs ?? []).length === 0) {
|
|
116
116
|
throw new Error(`could not get newer ibgib in timeline (E: 15fa346c8ac17edb96e4b0870104c122)`);
|
|
117
117
|
}
|
|
@@ -123,7 +123,7 @@ export class WitnessWithContextBase_V1 extends WitnessBase_V1 {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
else {
|
|
126
|
-
console.warn(`${lc} this.
|
|
126
|
+
console.warn(`${lc} this.metaspace undefined (W: 44cc5bf1b14b4695b8de4c589787be06)`);
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
catch (error) {
|
|
@@ -145,16 +145,16 @@ export class WitnessWithContextBase_V1 extends WitnessBase_V1 {
|
|
|
145
145
|
*
|
|
146
146
|
* @see {@link ibGibs}
|
|
147
147
|
* @see {@link rel8nName}
|
|
148
|
-
* @see {@link
|
|
148
|
+
* @see {@link metaspace}
|
|
149
149
|
* @see {@link space}
|
|
150
150
|
*
|
|
151
151
|
* ## notes
|
|
152
152
|
*
|
|
153
|
-
* * If there is no given `space`, then we will use the `
|
|
153
|
+
* * If there is no given `space`, then we will use the `metaspace` to get
|
|
154
154
|
* the local user space. If none, then we skip persistence.
|
|
155
|
-
* * If there is no `
|
|
155
|
+
* * If there is no `metaspace`, we won't register the new ibgibs locally.
|
|
156
156
|
*/
|
|
157
|
-
async rel8To({ ibGibs, rel8nName, linked,
|
|
157
|
+
async rel8To({ ibGibs, rel8nName, linked, metaspace,
|
|
158
158
|
// space,
|
|
159
159
|
}) {
|
|
160
160
|
const lc = `${this.lc}[${this.rel8To.name}]`;
|
|
@@ -174,21 +174,21 @@ export class WitnessWithContextBase_V1 extends WitnessBase_V1 {
|
|
|
174
174
|
if (thisValidationErrors?.length > 0) {
|
|
175
175
|
throw new Error(`this is an invalid ibGib. thisValidationErrors: ${thisValidationErrors.join('|')} (E: 8f08716866cd13bf254222ee9e6a6722)`);
|
|
176
176
|
}
|
|
177
|
-
|
|
178
|
-
if (!
|
|
179
|
-
// if (this.
|
|
180
|
-
// if (logalot) { console.log(`${lc}
|
|
181
|
-
//
|
|
177
|
+
metaspace = metaspace ?? this.metaspace;
|
|
178
|
+
if (!metaspace) {
|
|
179
|
+
// if (this.metaspace) {
|
|
180
|
+
// if (logalot) { console.log(`${lc} metaspace arg falsy, but we have a reference on this object, which we will use. (I: ee0d39a47ee8aee8ffd797721fea4322)`); }
|
|
181
|
+
// metaspace = this.metaspace;
|
|
182
182
|
// }
|
|
183
|
-
throw new Error(`either
|
|
183
|
+
throw new Error(`either metaspace or this.metaspace required (E: b5f9453ddb394a2b76dec74c7304df22)`);
|
|
184
184
|
}
|
|
185
185
|
// if (!space) {
|
|
186
|
-
// if (
|
|
187
|
-
// if (logalot) { console.log(`${lc} space arg falsy, but
|
|
188
|
-
// space = await
|
|
186
|
+
// if (metaspace) {
|
|
187
|
+
// if (logalot) { console.log(`${lc} space arg falsy, but metaspace truthy, so we'll use metaspace's local user space for persistence. (I: 37a4b4c1406556cb23831671755b0d22)`); }
|
|
188
|
+
// space = await metaspace.getLocalUserSpace({ lock: true });
|
|
189
189
|
// }
|
|
190
190
|
// }
|
|
191
|
-
// if (!space) { throw new Error(`(UNEXPECTED) space required and
|
|
191
|
+
// if (!space) { throw new Error(`(UNEXPECTED) space required and metaspace couldn't get it? (E: a3b9f9b72f6f6f18883199a19d38c622)`); }
|
|
192
192
|
// #endregion initialize, validate args and this
|
|
193
193
|
// we want to rel8 only to the ibGibs whose timelines we're not
|
|
194
194
|
// already related to. So we look to see if we already have the tjpGib
|
|
@@ -222,7 +222,7 @@ export class WitnessWithContextBase_V1 extends WitnessBase_V1 {
|
|
|
222
222
|
}
|
|
223
223
|
// if space is given, perform the persistence
|
|
224
224
|
// if (space) {
|
|
225
|
-
await
|
|
225
|
+
await metaspace.persistTransformResult({ resTransform: resNewThis });
|
|
226
226
|
// } else {
|
|
227
227
|
// if (logalot) { console.log(`${lc} space falsy, skipping persistence (I: 90aa3553e92ad1d02bce61f83648ea22)`); }
|
|
228
228
|
// }
|
|
@@ -230,7 +230,7 @@ export class WitnessWithContextBase_V1 extends WitnessBase_V1 {
|
|
|
230
230
|
// override `loadIbGibDto` to update secondary/derivative properties
|
|
231
231
|
await this.loadIbGibDto(newThisIbGib);
|
|
232
232
|
// (in the future, need to revisit the ibgibs service to the idea of locality/ies).
|
|
233
|
-
await
|
|
233
|
+
await metaspace.registerNewIbGib({ ibGib: newThisIbGib });
|
|
234
234
|
}
|
|
235
235
|
catch (error) {
|
|
236
236
|
console.error(`${lc} ${extractErrorMsg(error)}`);
|
|
@@ -253,10 +253,10 @@ export class WitnessWithContextBase_V1 extends WitnessBase_V1 {
|
|
|
253
253
|
if (!contextIbGib) {
|
|
254
254
|
throw new Error(`contextIbGib required (E: 85f27c7cbf713704c21084c141cd8822)`);
|
|
255
255
|
}
|
|
256
|
-
if (!this.
|
|
257
|
-
throw new Error(`this.
|
|
256
|
+
if (!this.metaspace) {
|
|
257
|
+
throw new Error(`this.metaspace required (E: 6a38c4274bdefc8d44cafd2d6faaa222)`);
|
|
258
258
|
}
|
|
259
|
-
// space = space ?? await this.
|
|
259
|
+
// space = space ?? await this.metaspace.getLocalUserSpace({ lock: true });
|
|
260
260
|
// if (!space) { throw new Error(`space required (E: 267ad87c148942cda641349df0bbbd22)`); }
|
|
261
261
|
if ((rel8nNames ?? []).length === 0) {
|
|
262
262
|
if (!this.data?.defaultRel8nName) {
|
|
@@ -276,10 +276,10 @@ export class WitnessWithContextBase_V1 extends WitnessBase_V1 {
|
|
|
276
276
|
nCounter: true
|
|
277
277
|
});
|
|
278
278
|
// ...persist it...
|
|
279
|
-
await this.
|
|
279
|
+
await this.metaspace.persistTransformResult({ resTransform: resRel8ToContext });
|
|
280
280
|
// ...register the context.
|
|
281
281
|
const { newIbGib: newContext } = resRel8ToContext;
|
|
282
|
-
await this.
|
|
282
|
+
await this.metaspace.registerNewIbGib({ ibGib: newContext });
|
|
283
283
|
}
|
|
284
284
|
catch (error) {
|
|
285
285
|
console.error(`${lc} ${extractErrorMsg(error)}`);
|
|
@@ -292,21 +292,21 @@ export class WitnessWithContextBase_V1 extends WitnessBase_V1 {
|
|
|
292
292
|
if (logalot) {
|
|
293
293
|
console.log(`${lc} starting... (I: c3a005f7d323468a5b4e1b2710901d22)`);
|
|
294
294
|
}
|
|
295
|
-
if (!this.
|
|
296
|
-
throw new Error(`this.
|
|
295
|
+
if (!this.metaspace) {
|
|
296
|
+
throw new Error(`this.metaspace required (E: 5dbb1a7f0ff5469b8ce3cb1be175e521)`);
|
|
297
297
|
}
|
|
298
|
-
// space = space ?? await this.
|
|
299
|
-
// if (!space) { throw new Error(`(UNEXPECTED) space required and wasn't able to get it from
|
|
300
|
-
let space = await this.
|
|
298
|
+
// space = space ?? await this.metaspace.getLocalUserSpace({ lock: true });
|
|
299
|
+
// if (!space) { throw new Error(`(UNEXPECTED) space required and wasn't able to get it from metaspace? (E: 7159f9893a66c28a7e09b61384545622)`); }
|
|
300
|
+
let space = await this.metaspace.getLocalUserSpace({ lock: true });
|
|
301
301
|
/** tag this comment with metadata to show it came from this witness */
|
|
302
302
|
let resComment = await createCommentIbGib({ text, addlMetadataText: this.getAddlMetadata(), saveInSpace: true, space });
|
|
303
303
|
// get again to be sure it's the latest space.
|
|
304
|
-
space = await this.
|
|
304
|
+
space = await this.metaspace.getLocalUserSpace({ lock: true });
|
|
305
305
|
const commentIbGib = resComment.newIbGib;
|
|
306
306
|
if (!commentIbGib) {
|
|
307
307
|
throw new Error(`(UNEXPECTED) failed to create comment? (E: 6d668f4e55198e654324622eabaac922)`);
|
|
308
308
|
}
|
|
309
|
-
await this.
|
|
309
|
+
await this.metaspace.registerNewIbGib({ ibGib: commentIbGib });
|
|
310
310
|
await this.rel8ToContextIbGib({ ibGibToRel8: commentIbGib, contextIbGib, rel8nNames: ['comment'] });
|
|
311
311
|
await this.rel8To({
|
|
312
312
|
ibGibs: [commentIbGib],
|
|
@@ -393,8 +393,8 @@ export class WitnessWithContextBase_V1 extends WitnessBase_V1 {
|
|
|
393
393
|
if (!arg && !addr) {
|
|
394
394
|
throw new Error(`either arg or addr required. (E: 3f647b65742242fd9ba878521acf7c22)`);
|
|
395
395
|
}
|
|
396
|
-
if (!this.
|
|
397
|
-
throw new Error(`(UNEXPECTED) this.
|
|
396
|
+
if (!this.metaspace) {
|
|
397
|
+
throw new Error(`(UNEXPECTED) this.metaspace required (E: f0046290b0d66d28c4bbbf83d9d9f523)`);
|
|
398
398
|
}
|
|
399
399
|
if (arg) {
|
|
400
400
|
if ((arg.ibGibs ?? []).length === 0) {
|
|
@@ -407,16 +407,16 @@ export class WitnessWithContextBase_V1 extends WitnessBase_V1 {
|
|
|
407
407
|
}
|
|
408
408
|
else {
|
|
409
409
|
// addr provided
|
|
410
|
-
const resGet = await this.
|
|
410
|
+
const resGet = await this.metaspace.get({ addr });
|
|
411
411
|
if (!resGet.success || resGet.ibGibs?.length !== 1) {
|
|
412
412
|
throw new Error(`could not get context addr (${addr}) (E: 834492313512a45b23a7bebacdc48122)`);
|
|
413
413
|
}
|
|
414
414
|
contextIbGib = resGet.ibGibs[0];
|
|
415
415
|
}
|
|
416
416
|
if (latest) {
|
|
417
|
-
const resLatestAddr = await this.
|
|
417
|
+
const resLatestAddr = await this.metaspace.getLatestAddr({ ibGib: contextIbGib });
|
|
418
418
|
if (resLatestAddr !== getIbGibAddr({ ibGib: contextIbGib })) {
|
|
419
|
-
const resGet = await this.
|
|
419
|
+
const resGet = await this.metaspace.get({ addr: resLatestAddr });
|
|
420
420
|
if (resGet.success && resGet.ibGibs?.length === 1) {
|
|
421
421
|
contextIbGib = resGet.ibGibs[0];
|
|
422
422
|
}
|
|
@@ -441,7 +441,7 @@ export class WitnessWithContextBase_V1 extends WitnessBase_V1 {
|
|
|
441
441
|
* The context is the ibgib where we are interacting with the user(s).
|
|
442
442
|
*
|
|
443
443
|
* When we initialize, we are setting state on this witness as well as
|
|
444
|
-
* subscribing to the context ibgib's updates in `this.
|
|
444
|
+
* subscribing to the context ibgib's updates in `this.metaspace`.
|
|
445
445
|
*
|
|
446
446
|
* if we already have a context, then this will check the new incoming
|
|
447
447
|
* context against it. If it's the same timeline, then this won't do
|
|
@@ -453,8 +453,8 @@ export class WitnessWithContextBase_V1 extends WitnessBase_V1 {
|
|
|
453
453
|
if (logalot) {
|
|
454
454
|
console.log(`${lc} starting... (I: d93429c85b0a494388f66fba3eece922)`);
|
|
455
455
|
}
|
|
456
|
-
if (!this.
|
|
457
|
-
throw new Error(`this.
|
|
456
|
+
if (!this.metaspace) {
|
|
457
|
+
throw new Error(`this.metaspace (metaspace) required. set this before using this witness. (E: 67db388a0223bf813b40accd9941ad23)`);
|
|
458
458
|
}
|
|
459
459
|
if (arg && contextIbGib) {
|
|
460
460
|
console.warn(`${lc} both arg and contextIbGib provided. using raw contextIbGib (W: d6d723ad7fb942079833c40647aecd22)`);
|
|
@@ -493,14 +493,14 @@ export class WitnessWithContextBase_V1 extends WitnessBase_V1 {
|
|
|
493
493
|
updatePriorChildren();
|
|
494
494
|
// subscribe to context ibgib updates
|
|
495
495
|
const contextTjpAddr = getTjpAddr({ ibGib: this._currentWorkingContextIbGib });
|
|
496
|
-
if (!this.
|
|
497
|
-
throw new Error(`(UNEXPECTED) this.
|
|
496
|
+
if (!this.metaspace) {
|
|
497
|
+
throw new Error(`(UNEXPECTED) this.metaspace falsy...not initialized? (E: 6e38bfdc5c2eb5fef884f0183889e823)`);
|
|
498
498
|
}
|
|
499
|
-
if (!this.
|
|
500
|
-
throw new Error(`(UNEXPECTED) this.
|
|
499
|
+
if (!this.metaspace.latestObs) {
|
|
500
|
+
throw new Error(`(UNEXPECTED) this.metaspace.latestObs falsy? (E: 831936570c14ed526f9c9ab511929923)`);
|
|
501
501
|
}
|
|
502
502
|
this._contextChangesSubscription =
|
|
503
|
-
await this.
|
|
503
|
+
await this.metaspace.latestObs
|
|
504
504
|
// .pipe(
|
|
505
505
|
// filter(x => x.tjpAddr === contextTjpAddr)
|
|
506
506
|
// ).subscribe(async (update: any) => {
|
|
@@ -543,7 +543,7 @@ export class WitnessWithContextBase_V1 extends WitnessBase_V1 {
|
|
|
543
543
|
},
|
|
544
544
|
error: async (err) => {
|
|
545
545
|
const lcErr = `${lc}[latestObs.error]`;
|
|
546
|
-
console.error(`${lcErr} this.
|
|
546
|
+
console.error(`${lcErr} this.metaspace.latestObs error: ${extractObsErrMsg({ err })}. (E: 99df4c42195d46d0a9dbfb06ac45ae00)`);
|
|
547
547
|
},
|
|
548
548
|
}));
|
|
549
549
|
// rel8 to the context (conversation)
|
|
@@ -558,7 +558,7 @@ export class WitnessWithContextBase_V1 extends WitnessBase_V1 {
|
|
|
558
558
|
// if needed)
|
|
559
559
|
// let gibInfo = getGibInfo({ gib: this._currentWorkingContextIbGib.gib });
|
|
560
560
|
// if (gibInfo.tjpGib) {
|
|
561
|
-
// this.
|
|
561
|
+
// this.metaspace.latestObs
|
|
562
562
|
// .subscribe(update => {
|
|
563
563
|
// if (!update.tjpAddr) { return; /* <<<< returns early */ }
|
|
564
564
|
// if (getIbAndGib({ ibGibAddr: update.tjpAddr }).gib !== gibInfo.tjpGib) { return; /* <<<< returns early */ }
|
|
@@ -724,10 +724,10 @@ export class WitnessWithContextBase_V1 extends WitnessBase_V1 {
|
|
|
724
724
|
return []; /* <<<< returns early */
|
|
725
725
|
}
|
|
726
726
|
// get the latest addrs for those children
|
|
727
|
-
if (!this.
|
|
728
|
-
throw new Error(`this.
|
|
727
|
+
if (!this.metaspace) {
|
|
728
|
+
throw new Error(`this.metaspace falsy. not initialized? (E: 1cc26ca7de7fadcdbaecbd6613350e23)`);
|
|
729
729
|
}
|
|
730
|
-
const space = await this.
|
|
730
|
+
const space = await this.metaspace.getLocalUserSpace({});
|
|
731
731
|
if (!space) {
|
|
732
732
|
throw new Error(`couldn't get local user space? (E: f118f75e5852fc22bba3a6495beec723)`);
|
|
733
733
|
}
|
|
@@ -741,7 +741,7 @@ export class WitnessWithContextBase_V1 extends WitnessBase_V1 {
|
|
|
741
741
|
// some of the addrs were not found in the space
|
|
742
742
|
throw new Error(`some addrs were not found in the space. (E: 2216d8e5ad7fb600ceb025ed7c90f323)`);
|
|
743
743
|
}
|
|
744
|
-
const resGet = await this.
|
|
744
|
+
const resGet = await this.metaspace.get({ addrs: latestAddrs });
|
|
745
745
|
if (!resGet.success || resGet.ibGibs?.length !== newChildrenAddrs.length) {
|
|
746
746
|
throw new Error(`failed to get newChildren with addrs: ${newChildrenAddrs.join('|')}. Error: ${resGet.errorMsg ?? 'unknown error 5737bd0996d5445b8bd80975bedc0d57'} (E: 05722e11350ec6ffffdb5c7d0caa2922)`);
|
|
747
747
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibgib/core-gib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.78",
|
|
4
4
|
"description": "ibgib core functionality, including base architecture for witnesses, spaces, apps, robbots, etc., as well as shared utility functions. Node v19+ needed for heavily-used isomorphic webcrypto hashing consumed in both node and browsers.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://gitlab.com/ibgib/core-gib",
|
|
@@ -64,7 +64,7 @@ export abstract class ObservableBase_V1<
|
|
|
64
64
|
* Reference to the local ibgibs service, which is one way at getting at the
|
|
65
65
|
* local user space.
|
|
66
66
|
*/
|
|
67
|
-
public
|
|
67
|
+
public metaspace: MetaspaceService | undefined;
|
|
68
68
|
|
|
69
69
|
protected _subscribers: { [subscriptionId: string]: [SubscriptionWitness, ObserverWitness<TIbGibIn_ie_Payload> | WitnessAny] } = {};
|
|
70
70
|
|
|
@@ -89,7 +89,7 @@ export class Subject_V1<
|
|
|
89
89
|
* Reference to the local ibgibs service, which is one way at getting at the
|
|
90
90
|
* local user space.
|
|
91
91
|
*/
|
|
92
|
-
public
|
|
92
|
+
public metaspace: MetaspaceService | undefined;
|
|
93
93
|
|
|
94
94
|
constructor(initialData?: SubjectData_V1, initialRel8ns?: SubjectRel8ns_V1) {
|
|
95
95
|
super(initialData, initialRel8ns);
|
|
@@ -82,7 +82,7 @@ export class Subscription_V1
|
|
|
82
82
|
* Reference to the local ibgibs service, which is one way at getting at the
|
|
83
83
|
* local user space.
|
|
84
84
|
*/
|
|
85
|
-
public
|
|
85
|
+
public metaspace: MetaspaceService | undefined;
|
|
86
86
|
|
|
87
87
|
/**
|
|
88
88
|
* this is UNDEFINED if we have not yet subscribed.
|
|
@@ -61,7 +61,7 @@ export abstract class AppBase_V1<
|
|
|
61
61
|
* Reference to the local ibgibs service, which is one way at getting at the
|
|
62
62
|
* local user space.
|
|
63
63
|
*/
|
|
64
|
-
|
|
64
|
+
metaspace: MetaspaceService | undefined;
|
|
65
65
|
|
|
66
66
|
constructor(initialData?: TData, initialRel8ns?: TRel8ns) {
|
|
67
67
|
super(initialData, initialRel8ns);
|
|
@@ -69,7 +69,7 @@ export abstract class KeystoneBase_V1<
|
|
|
69
69
|
* Reference to the local ibgibs service, which is one way at getting at the
|
|
70
70
|
* local user space.
|
|
71
71
|
*/
|
|
72
|
-
|
|
72
|
+
metaspace: MetaspaceService | undefined;
|
|
73
73
|
|
|
74
74
|
constructor(initialData?: TData, initialRel8ns?: TRel8ns) {
|
|
75
75
|
super(initialData, initialRel8ns);
|
|
@@ -685,8 +685,8 @@ export abstract class RobbotBase_V1<
|
|
|
685
685
|
|
|
686
686
|
await this.loadNewerSelfIfAvailable();
|
|
687
687
|
|
|
688
|
-
if (!this.
|
|
689
|
-
const space = await this.
|
|
688
|
+
if (!this.metaspace) { throw new Error(`this.metaspace falsy (E: fd2f9e4384a725122f4de2eb76696923)`); }
|
|
689
|
+
const space = await this.metaspace.getLocalUserSpace({ lock: true });
|
|
690
690
|
|
|
691
691
|
const rel8dIbGibs: { [rel8nName: string]: IbGib_V1[] } = {};
|
|
692
692
|
|
|
@@ -459,8 +459,11 @@ export abstract class MetaspaceBase implements MetaspaceService {
|
|
|
459
459
|
protected cacheSvc: IbGibCacheService | undefined,
|
|
460
460
|
) {
|
|
461
461
|
const lc = `${this.lc}[ctor]`;
|
|
462
|
-
if (logalot) {
|
|
463
|
-
|
|
462
|
+
if (logalot) {
|
|
463
|
+
console.log(`${lc}${GLOBAL_TIMER_NAME}`);
|
|
464
|
+
console.timeLog(GLOBAL_TIMER_NAME);
|
|
465
|
+
console.log(`${lc} created. (I: 5fe7af9fccc2488282eecc8255729cec)`);
|
|
466
|
+
}
|
|
464
467
|
}
|
|
465
468
|
|
|
466
469
|
protected async initializeMetaspaceFactory({ metaspaceFactory }: { metaspaceFactory: MetaspaceFactory }): Promise<void> {
|
|
@@ -1583,11 +1586,17 @@ export abstract class MetaspaceBase implements MetaspaceService {
|
|
|
1583
1586
|
initialize,
|
|
1584
1587
|
space,
|
|
1585
1588
|
lock,
|
|
1589
|
+
dontWarnIfNotExist,
|
|
1586
1590
|
}: {
|
|
1587
1591
|
type: SpecialIbGibType,
|
|
1588
1592
|
initialize?: boolean,
|
|
1589
1593
|
space?: IbGibSpaceAny,
|
|
1590
1594
|
lock?: boolean,
|
|
1595
|
+
/**
|
|
1596
|
+
* if true, won't warn about non-existent/non-initialized things.
|
|
1597
|
+
* useful if you are just checking to see if a special ibgib exists.
|
|
1598
|
+
*/
|
|
1599
|
+
dontWarnIfNotExist?: boolean,
|
|
1591
1600
|
}): Promise<IbGib_V1 | null> {
|
|
1592
1601
|
const lc = `${this.lc}[${this.getSpecialIbGib.name}]`;
|
|
1593
1602
|
try {
|
|
@@ -1607,7 +1616,8 @@ export abstract class MetaspaceBase implements MetaspaceService {
|
|
|
1607
1616
|
fnUpdateBootstrap: (x) => this.fnUpdateBootstrap(x),
|
|
1608
1617
|
fnBroadcast: (x) => this.fnBroadcast(x),
|
|
1609
1618
|
fnGetInitializing: () => { return this._initializing; },
|
|
1610
|
-
fnSetInitializing: (value: boolean) => { this._initializing = value; }
|
|
1619
|
+
fnSetInitializing: (value: boolean) => { this._initializing = value; },
|
|
1620
|
+
dontWarnIfNotExist,
|
|
1611
1621
|
});
|
|
1612
1622
|
} catch (error) {
|
|
1613
1623
|
console.error(`${lc} ${error.message}`);
|
|
@@ -485,6 +485,11 @@ export interface MetaspaceService {
|
|
|
485
485
|
initialize?: boolean,
|
|
486
486
|
space?: IbGibSpaceAny,
|
|
487
487
|
lock?: boolean,
|
|
488
|
+
/**
|
|
489
|
+
* if true, won't warn about non-existent/non-initialized things.
|
|
490
|
+
* useful if you are just checking to see if a special ibgib exists.
|
|
491
|
+
*/
|
|
492
|
+
dontWarnIfNotExist?: boolean,
|
|
488
493
|
}): Promise<IbGib_V1 | null>;
|
|
489
494
|
getSpecialRel8dIbGibs<TIbGib extends IbGib_V1 = IbGib_V1>(arg: {
|
|
490
495
|
type: SpecialIbGibType,
|
|
@@ -380,6 +380,7 @@ export async function getSpecialIbGib({
|
|
|
380
380
|
fnBroadcast,
|
|
381
381
|
fnGetInitializing,
|
|
382
382
|
fnSetInitializing,
|
|
383
|
+
dontWarnIfNotExist,
|
|
383
384
|
}: {
|
|
384
385
|
type: SpecialIbGibType,
|
|
385
386
|
initialize?: boolean,
|
|
@@ -406,6 +407,11 @@ export async function getSpecialIbGib({
|
|
|
406
407
|
* Because we don't want to initialize while we're initializing.
|
|
407
408
|
*/
|
|
408
409
|
fnSetInitializing?: (x: boolean) => void,
|
|
410
|
+
/**
|
|
411
|
+
* if true, won't warn about non-existent/non-initialized things.
|
|
412
|
+
* useful if you are just checking to see if a special ibgib exists.
|
|
413
|
+
*/
|
|
414
|
+
dontWarnIfNotExist?: boolean,
|
|
409
415
|
}): Promise<IbGib_V1 | null> {
|
|
410
416
|
const lc = `[${getSpecialIbGib.name}]`;
|
|
411
417
|
try {
|
|
@@ -414,7 +420,7 @@ export async function getSpecialIbGib({
|
|
|
414
420
|
let key = getSpecialConfigKey({ type });
|
|
415
421
|
let addr = await getConfigAddr({
|
|
416
422
|
key, space,
|
|
417
|
-
dontWarn: !!initialize // dont warn if we're initializing
|
|
423
|
+
dontWarn: dontWarnIfNotExist || !!initialize // dont warn if we're initializing
|
|
418
424
|
});
|
|
419
425
|
|
|
420
426
|
if (!addr) {
|
|
@@ -652,6 +658,10 @@ export async function getConfigAddr({
|
|
|
652
658
|
}: {
|
|
653
659
|
key: string,
|
|
654
660
|
space: IbGibSpaceAny,
|
|
661
|
+
/**
|
|
662
|
+
* if true, won't warn about non-existent/non-initialized things.
|
|
663
|
+
* useful if you are just checking to see if a special ibgib exists.
|
|
664
|
+
*/
|
|
655
665
|
dontWarn?: boolean,
|
|
656
666
|
}): Promise<string | undefined> {
|
|
657
667
|
const lc = `[${getConfigAddr.name}](${key})`;
|