@omercnet/paseo-omp 0.4.0-next.138.1 → 0.4.0-next.139.1

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/index.client.tsx CHANGED
@@ -452,7 +452,25 @@ export default function contribute(client: PluginClientContext) {
452
452
  }, RECONCILE_DEBOUNCE_MS);
453
453
  }
454
454
 
455
- const unsubscribeAgents = client.paseo.agents.subscribe(scheduleReconcile);
455
+ let unsubscribeAgentDirectory = () => {};
456
+ let releaseAgentDirectory: (() => Promise<void>) | undefined;
457
+ void client.paseo.agents
458
+ .list({ subscribe: {} })
459
+ .then(({ subscription }) => {
460
+ if (!subscription) return;
461
+ if (disposed) {
462
+ void subscription.release().catch(() => {});
463
+ return;
464
+ }
465
+ unsubscribeAgentDirectory = subscription.subscribe({
466
+ snapshot: scheduleReconcile,
467
+ update: scheduleReconcile,
468
+ error: () => {},
469
+ });
470
+ releaseAgentDirectory = () => subscription.release();
471
+ void subscription.ready.catch(() => {});
472
+ })
473
+ .catch(() => {});
456
474
  const hubPoll = setInterval(() => {
457
475
  void refreshHubStatus();
458
476
  }, STATUS_POLL_MS);
@@ -467,7 +485,8 @@ export default function contribute(client: PluginClientContext) {
467
485
  return () => {
468
486
  disposed = true;
469
487
  settingsGeneration += 1;
470
- unsubscribeAgents();
488
+ unsubscribeAgentDirectory();
489
+ if (releaseAgentDirectory) void releaseAgentDirectory().catch(() => {});
471
490
  clearTimeout(reconcileTimer);
472
491
  clearInterval(hubPoll);
473
492
  clearInterval(quotaPoll);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omercnet/paseo-omp",
3
- "version": "0.4.0-next.138.1",
3
+ "version": "0.4.0-next.139.1",
4
4
  "type": "module",
5
5
  "description": "Paseo integration for OMP, including its direct provider and workspace tooling.",
6
6
  "license": "MIT",
@@ -1,2 +1,2 @@
1
1
  /** Release Please keeps this bundle-safe constant aligned with package.json. */
2
- export const PASEO_OMP_PACKAGE_VERSION = "0.4.0-next.138.1"; // x-release-please-version
2
+ export const PASEO_OMP_PACKAGE_VERSION = "0.4.0-next.139.1"; // x-release-please-version