holosphere 2.0.0-alpha17 → 2.0.0-alpha19
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/{2019-C9IgM3mu.cjs → 2019-CAYA1q1p.cjs} +2 -2
- package/dist/{2019-C9IgM3mu.cjs.map → 2019-CAYA1q1p.cjs.map} +1 -1
- package/dist/{2019-CyFQLuqg.js → 2019-Cc18leNN.js} +2 -2
- package/dist/{2019-CyFQLuqg.js.map → 2019-Cc18leNN.js.map} +1 -1
- package/dist/{browser-CZ1l8nhY.cjs → browser-DAFvFs8I.cjs} +2 -2
- package/dist/{browser-CZ1l8nhY.cjs.map → browser-DAFvFs8I.cjs.map} +1 -1
- package/dist/{browser-BIvmkBi9.js → browser-yWnjyL8K.js} +2 -2
- package/dist/{browser-BIvmkBi9.js.map → browser-yWnjyL8K.js.map} +1 -1
- package/dist/cjs/holosphere.cjs +1 -1
- package/dist/esm/holosphere.js +1 -1
- package/dist/{index-HW9kbrzC.js → index-Bgi_csBR.js} +2 -2
- package/dist/{index-HW9kbrzC.js.map → index-Bgi_csBR.js.map} +1 -1
- package/dist/{index-B7ERi4ng.js → index-CHfVBEUH.js} +132 -101
- package/dist/index-CHfVBEUH.js.map +1 -0
- package/dist/{index-Cc-_uNpt.cjs → index-CPvYlZtl.cjs} +2 -2
- package/dist/{index-Cc-_uNpt.cjs.map → index-CPvYlZtl.cjs.map} +1 -1
- package/dist/{index-DusXavIT.js → index-CReYsOty.js} +2 -2
- package/dist/{index-DusXavIT.js.map → index-CReYsOty.js.map} +1 -1
- package/dist/index-Dgx5DQG_.cjs +29 -0
- package/dist/index-Dgx5DQG_.cjs.map +1 -0
- package/dist/{index-VrRkpshF.cjs → index-bnw0PiyT.cjs} +2 -2
- package/dist/{index-VrRkpshF.cjs.map → index-bnw0PiyT.cjs.map} +1 -1
- package/dist/{indexeddb-storage-CVz4Q3lo.cjs → indexeddb-storage-CyOZAiHV.cjs} +2 -2
- package/dist/{indexeddb-storage-CVz4Q3lo.cjs.map → indexeddb-storage-CyOZAiHV.cjs.map} +1 -1
- package/dist/{indexeddb-storage-yEswGGMG.js → indexeddb-storage-Ko4sjZtM.js} +2 -2
- package/dist/{indexeddb-storage-yEswGGMG.js.map → indexeddb-storage-Ko4sjZtM.js.map} +1 -1
- package/dist/{memory-storage-CSB5_IfU.js → memory-storage-BTfQQ9Ig.js} +2 -2
- package/dist/{memory-storage-CSB5_IfU.js.map → memory-storage-BTfQQ9Ig.js.map} +1 -1
- package/dist/{memory-storage-Q8mEQ6Ix.cjs → memory-storage-C6YV3dsT.cjs} +2 -2
- package/dist/{memory-storage-Q8mEQ6Ix.cjs.map → memory-storage-C6YV3dsT.cjs.map} +1 -1
- package/package.json +1 -1
- package/src/federation/registry.js +70 -0
- package/src/index.js +80 -90
- package/src/storage/nostr-async.js +12 -8
- package/src/storage/nostr-client.js +5 -2
- package/src/subscriptions/manager.js +13 -4
- package/dist/index-B7ERi4ng.js.map +0 -1
- package/dist/index-DXFsE8r6.cjs +0 -29
- package/dist/index-DXFsE8r6.cjs.map +0 -1
|
@@ -523,8 +523,11 @@ export class NostrClient {
|
|
|
523
523
|
dataDir: this.config.dataDir
|
|
524
524
|
});
|
|
525
525
|
|
|
526
|
-
// Load cached events from persistent storage
|
|
527
|
-
|
|
526
|
+
// Load cached events from persistent storage in background
|
|
527
|
+
// (non-blocking to avoid stalling _initReady with large data sets)
|
|
528
|
+
this._loadFromPersistentStorage().catch(err => {
|
|
529
|
+
console.warn('Background persistent storage load failed:', err);
|
|
530
|
+
});
|
|
528
531
|
|
|
529
532
|
// Initialize outbox queue for guaranteed delivery
|
|
530
533
|
this.outboxQueue = new OutboxQueue(this.persistentStorage, {
|
|
@@ -23,7 +23,7 @@ import { resolveHologram } from '../federation/hologram.js';
|
|
|
23
23
|
* @returns {Promise<Object>} Subscription object with path and unsubscribe method
|
|
24
24
|
*/
|
|
25
25
|
export async function createSubscription(client, path, callback, options = {}) {
|
|
26
|
-
const { throttle = 0, filter = null, includeFederated = false, triggerInitial = false, realtimeOnly = true, resolveHolograms = true } = options;
|
|
26
|
+
const { throttle = 0, filter = null, includeFederated = false, triggerInitial = false, realtimeOnly = true, resolveHolograms = true, appname = null } = options;
|
|
27
27
|
|
|
28
28
|
let lastInvoke = 0;
|
|
29
29
|
let timeoutId = null;
|
|
@@ -48,13 +48,22 @@ export async function createSubscription(client, path, callback, options = {}) {
|
|
|
48
48
|
let resolvedData = data;
|
|
49
49
|
if (resolveHolograms && data && data.hologram === true) {
|
|
50
50
|
try {
|
|
51
|
-
resolvedData = await resolveHologram(client, data);
|
|
51
|
+
resolvedData = await resolveHologram(client, data, undefined, undefined, { appname });
|
|
52
52
|
// If resolution failed, skip this item (source data may not exist yet)
|
|
53
53
|
if (!resolvedData) {
|
|
54
|
+
console.debug('[subscription] Hologram resolution returned null, skipping:', {
|
|
55
|
+
id: data.id,
|
|
56
|
+
soul: data.soul,
|
|
57
|
+
target: data.target?.holonId?.slice(0, 12)
|
|
58
|
+
});
|
|
54
59
|
return;
|
|
55
60
|
}
|
|
56
61
|
} catch (err) {
|
|
57
|
-
console.warn('Failed to resolve hologram in subscription:', err
|
|
62
|
+
console.warn('Failed to resolve hologram in subscription:', err, {
|
|
63
|
+
id: data?.id,
|
|
64
|
+
soul: data?.soul,
|
|
65
|
+
target: data?.target?.holonId?.slice(0, 12)
|
|
66
|
+
});
|
|
58
67
|
return;
|
|
59
68
|
}
|
|
60
69
|
}
|
|
@@ -85,7 +94,7 @@ export async function createSubscription(client, path, callback, options = {}) {
|
|
|
85
94
|
};
|
|
86
95
|
|
|
87
96
|
// Subscribe using Nostr wrapper
|
|
88
|
-
const subscription = await subscribe(client, path, wrappedCallback, { realtimeOnly });
|
|
97
|
+
const subscription = await subscribe(client, path, wrappedCallback, { realtimeOnly, ...(options.authors && { authors: options.authors }) });
|
|
89
98
|
|
|
90
99
|
// Return subscription object
|
|
91
100
|
return {
|