mnfst 0.5.223 → 0.5.225

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  (function () {
4
4
 
5
- const MANIFEST_BUILD_VERSION = '0.5.223';
5
+ const MANIFEST_BUILD_VERSION = '0.5.225';
6
6
 
7
7
  /* Manifest Data Sources - Appwrite Integration */
8
8
 
@@ -671,7 +671,8 @@ window.ManifestDataAppwrite = {
671
671
  const subscriptions = new Map(); // Map<dataSourceName, unsubscribeFunction>
672
672
 
673
673
  // Subscribe to storage bucket file changes
674
- async function subscribeToStorageBucket(dataSourceName, bucketId, scope, onEvent) {
674
+ // isCurrent: false once the requesting load is superseded (logout) — skip, never touch a newer entry
675
+ async function subscribeToStorageBucket(dataSourceName, bucketId, scope, onEvent, isCurrent) {
675
676
  // Unsubscribe from existing subscription if any
676
677
  if (subscriptions.has(dataSourceName)) {
677
678
  const unsubscribe = subscriptions.get(dataSourceName);
@@ -682,6 +683,7 @@ async function subscribeToStorageBucket(dataSourceName, bucketId, scope, onEvent
682
683
  }
683
684
 
684
685
  const services = await window.ManifestDataAppwrite.getAppwriteDataServices();
686
+ if (isCurrent && !isCurrent()) return null;
685
687
  if (!services?.realtime) {
686
688
  console.warn('[Manifest Data] Realtime service not available for', dataSourceName);
687
689
  return null;
@@ -751,7 +753,7 @@ function unsubscribeAll() {
751
753
  }
752
754
 
753
755
  // Subscribe to database table row changes
754
- async function subscribeToTable(dataSourceName, databaseId, tableId, scope, onEvent) {
756
+ async function subscribeToTable(dataSourceName, databaseId, tableId, scope, onEvent, isCurrent) {
755
757
  // Unsubscribe from existing subscription if any
756
758
  if (subscriptions.has(dataSourceName)) {
757
759
  const unsubscribe = subscriptions.get(dataSourceName);
@@ -762,6 +764,7 @@ async function subscribeToTable(dataSourceName, databaseId, tableId, scope, onEv
762
764
  }
763
765
 
764
766
  const services = await window.ManifestDataAppwrite.getAppwriteDataServices();
767
+ if (isCurrent && !isCurrent()) return null;
765
768
  if (!services?.realtime) {
766
769
  console.warn('[Manifest Data] Realtime service not available for', dataSourceName);
767
770
  return null;