@amityco/ts-sdk 0.0.1-beta.42.1 → 0.0.1-beta.42.2

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 (30) hide show
  1. package/dist/cache/utils/index.d.ts +1 -0
  2. package/dist/cache/utils/index.d.ts.map +1 -1
  3. package/dist/channel/observers/liveChannels.d.ts.map +1 -1
  4. package/dist/comment/observers/liveComments.d.ts.map +1 -1
  5. package/dist/community/observers/liveCommunities.d.ts.map +1 -1
  6. package/dist/index.cjs.js +25 -19
  7. package/dist/index.esm.js +25 -19
  8. package/dist/index.umd.js +4 -4
  9. package/dist/message/observers/liveMessages.d.ts.map +1 -1
  10. package/dist/post/observers/livePosts.d.ts.map +1 -1
  11. package/dist/subChannel/observers/liveSubChannels.d.ts.map +1 -1
  12. package/dist/utils/constants.d.ts +1 -0
  13. package/dist/utils/constants.d.ts.map +1 -1
  14. package/dist/utils/tests/dummy/community.d.ts +1 -1
  15. package/package.json +1 -1
  16. package/src/cache/utils/index.ts +5 -2
  17. package/src/channel/api/tests/addChannelMembers.test.ts +13 -0
  18. package/src/channel/api/tests/queryChannelMembers.test.ts +1 -0
  19. package/src/channel/api/tests/removeChannelMembers.test.ts +9 -2
  20. package/src/channel/observers/liveChannels.ts +11 -9
  21. package/src/comment/observers/liveComments.ts +9 -6
  22. package/src/community/observers/liveCommunities.ts +9 -6
  23. package/src/message/api/tests/createMessage.test.ts +10 -3
  24. package/src/message/api/tests/deleteMessage.test.ts +10 -3
  25. package/src/message/api/tests/getMessage.test.ts +9 -3
  26. package/src/message/api/tests/updateMessage.test.ts +9 -2
  27. package/src/message/observers/liveMessages.ts +2 -1
  28. package/src/post/observers/livePosts.ts +12 -9
  29. package/src/subChannel/observers/liveSubChannels.ts +4 -3
  30. package/src/utils/constants.ts +2 -1
@@ -2,6 +2,7 @@ export declare const CACHE_KEY_GET = "get";
2
2
  export declare const CACHE_KEY_QUERY = "query";
3
3
  export declare const CACHE_KEY_TOMBSTONE = "dead";
4
4
  export declare const CACHE_KEY_COLLECTION = "collection";
5
+ export declare const CACHE_SHORTEN_LIFESPAN: number;
5
6
  export declare const CACHE_LIFESPAN: number;
6
7
  export declare const CACHE_LIFESPAN_TOMBSTONE: number;
7
8
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cache/utils/index.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,aAAa,QAAQ,CAAC;AACnC,eAAO,MAAM,eAAe,UAAU,CAAC;AACvC,eAAO,MAAM,mBAAmB,SAAS,CAAC;AAC1C,eAAO,MAAM,oBAAoB,eAAe,CAAC;AAEjD,eAAO,MAAM,cAAc,QAAgB,CAAC;AAC5C,eAAO,MAAM,wBAAwB,QAAgB,CAAC;AAkBtD;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,2BAA0B,MACmC,CAAC;AAEpF;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,QAAS,MAAM,mBAAoC,CAAC;AAE1E;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,cAAe,GAAG,aAAa,GAAG,KAAG,OAa7D,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,4BAA6B,GAAG,2BACU,CAAC;AAEhE;;;;;;;;;GASG;AACH,eAAO,MAAM,4BAA4B,cAAe,MAAM,WAAW,KAAG,OACS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cache/utils/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,QAAQ,CAAC;AACnC,eAAO,MAAM,eAAe,UAAU,CAAC;AACvC,eAAO,MAAM,mBAAmB,SAAS,CAAC;AAC1C,eAAO,MAAM,oBAAoB,eAAe,CAAC;AAEjD,eAAO,MAAM,sBAAsB,QAAa,CAAC;AACjD,eAAO,MAAM,cAAc,QAAa,CAAC;AACzC,eAAO,MAAM,wBAAwB,QAAa,CAAC;AAkBnD;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,2BAA0B,MACmC,CAAC;AAEpF;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,QAAS,MAAM,mBAAoC,CAAC;AAE1E;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,cAAe,GAAG,aAAa,GAAG,KAAG,OAa7D,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,4BAA6B,GAAG,2BACU,CAAC;AAEhE;;;;;;;;;GASG;AACH,eAAO,MAAM,4BAA4B,cAAe,MAAM,WAAW,KAAG,OACS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"liveChannels.d.ts","sourceRoot":"","sources":["../../../src/channel/observers/liveChannels.ts"],"names":[],"mappings":"AAiCA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,YAAY,WACf,MAAM,qBAAqB,YACzB,MAAM,sBAAsB,CAAC,MAAM,OAAO,CAAC,WAC5C,MAAM,oBAAoB,eAiJpC,CAAC"}
1
+ {"version":3,"file":"liveChannels.d.ts","sourceRoot":"","sources":["../../../src/channel/observers/liveChannels.ts"],"names":[],"mappings":"AAkCA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,YAAY,WACf,MAAM,qBAAqB,YACzB,MAAM,sBAAsB,CAAC,MAAM,OAAO,CAAC,WAC5C,MAAM,oBAAoB,eAkJpC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"liveComments.d.ts","sourceRoot":"","sources":["../../../src/comment/observers/liveComments.ts"],"names":[],"mappings":"AA6BA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,YAAY,WACf,MAAM,qBAAqB,YACzB,MAAM,sBAAsB,CAAC,aAAa,CAAC,WAC5C,MAAM,oBAAoB,KAClC,MAAM,YAwHR,CAAC"}
1
+ {"version":3,"file":"liveComments.d.ts","sourceRoot":"","sources":["../../../src/comment/observers/liveComments.ts"],"names":[],"mappings":"AA+BA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,YAAY,WACf,MAAM,qBAAqB,YACzB,MAAM,sBAAsB,CAAC,aAAa,CAAC,WAC5C,MAAM,oBAAoB,KAClC,MAAM,YAyHR,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"liveCommunities.d.ts","sourceRoot":"","sources":["../../../src/community/observers/liveCommunities.ts"],"names":[],"mappings":"AA4BA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,eAAe,WAClB,MAAM,uBAAuB,YAC3B,MAAM,sBAAsB,CAAC,MAAM,SAAS,CAAC,WAC9C,MAAM,oBAAoB,eA6IpC,CAAC"}
1
+ {"version":3,"file":"liveCommunities.d.ts","sourceRoot":"","sources":["../../../src/community/observers/liveCommunities.ts"],"names":[],"mappings":"AA8BA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,eAAe,WAClB,MAAM,uBAAuB,YAC3B,MAAM,sBAAsB,CAAC,MAAM,SAAS,CAAC,WAC9C,MAAM,oBAAoB,eA8IpC,CAAC"}
package/dist/index.cjs.js CHANGED
@@ -95,8 +95,8 @@ const PostContentType = Object.freeze({
95
95
 
96
96
  function getVersion() {
97
97
  try {
98
- // the string ''v0.0.1-beta.42.1-cjs'' should be replaced by actual value by @rollup/plugin-replace
99
- return 'v0.0.1-beta.42.1-cjs';
98
+ // the string ''v0.0.1-beta.42.2-cjs'' should be replaced by actual value by @rollup/plugin-replace
99
+ return 'v0.0.1-beta.42.2-cjs';
100
100
  }
101
101
  catch (error) {
102
102
  return '__dev__';
@@ -104,11 +104,22 @@ function getVersion() {
104
104
  }
105
105
  const VERSION = getVersion();
106
106
 
107
+ const COLLECTION_DEFAULT_PAGINATION_LIMIT = 5;
108
+ const COLLECTION_DEFAULT_CACHING_POLICY = 'cache_then_server';
109
+ const ENABLE_CACHE_MESSAGE = 'For using Live Collection feature you need to enable Cache!';
110
+ const LIVE_OBJECT_ENABLE_CACHE_MESSAGE = 'For using Live Object feature you need to enable Cache!';
111
+ const UNSYNCED_OBJECT_CACHED_AT_MESSAGE = 'Observing unsynced object is not supported by Live Object.';
112
+ const UNSYNCED_OBJECT_CACHED_AT_VALUE = -5;
113
+ const SECOND = 1000;
114
+ const MINUTE = 60 * SECOND;
115
+ const ACCESS_TOKEN_WATCHER_INTERVAL = 10 * MINUTE;
116
+
107
117
  // cache constants
108
118
  const CACHE_KEY_GET = 'get';
109
119
  const CACHE_KEY_TOMBSTONE = 'dead';
110
- const CACHE_LIFESPAN = 1 * 60 * 1000; // 1 minute
111
- const CACHE_LIFESPAN_TOMBSTONE = 3 * 60 * 1000; // 3 minutes
120
+ const CACHE_SHORTEN_LIFESPAN = 2 * SECOND;
121
+ const CACHE_LIFESPAN = 1 * MINUTE; // 1 minute
122
+ const CACHE_LIFESPAN_TOMBSTONE = 3 * MINUTE; // 3 minutes
112
123
  /**
113
124
  * Shallow-clones an object and sort its keys
114
125
  *
@@ -20381,15 +20392,6 @@ const getFeedSettings = async () => {
20381
20392
  }));
20382
20393
  };
20383
20394
 
20384
- const COLLECTION_DEFAULT_PAGINATION_LIMIT = 5;
20385
- const COLLECTION_DEFAULT_CACHING_POLICY = 'cache_then_server';
20386
- const ENABLE_CACHE_MESSAGE = 'For using Live Collection feature you need to enable Cache!';
20387
- const LIVE_OBJECT_ENABLE_CACHE_MESSAGE = 'For using Live Object feature you need to enable Cache!';
20388
- const UNSYNCED_OBJECT_CACHED_AT_MESSAGE = 'Observing unsynced object is not supported by Live Object.';
20389
- const UNSYNCED_OBJECT_CACHED_AT_VALUE = -5;
20390
- const MINUTE = 60 * 1000;
20391
- const ACCESS_TOKEN_WATCHER_INTERVAL = 10 * MINUTE;
20392
-
20393
20395
  // TODO: find a way to uniquely identify the device
20394
20396
  /** @hidden */
20395
20397
  const getDeviceId = () => {
@@ -26911,13 +26913,14 @@ const liveChannels = (params, callback, config) => {
26911
26913
  }
26912
26914
  pushToCache(cacheKey, data);
26913
26915
  responder(data);
26914
- }, queryOptions(policy));
26916
+ }, queryOptions(policy, CACHE_SHORTEN_LIFESPAN));
26915
26917
  };
26916
26918
  disposers.push(onChannelCreated(realtimeRouter()), onChannelDeleted(realtimeRouter()), onChannelUpdated(realtimeRouter()), onChannelMuted(realtimeRouter()), onChannelJoined(realtimeRouter()), onChannelLeft(realtimeRouter()), onChannelMemberAdded(realtimeRouter()), onChannelMemberRemoved(realtimeRouter()), onMessageCreated(() => null));
26917
26919
  onFetch();
26918
26920
  return () => {
26919
26921
  log(`liveChannels(tmpid: ${timestamp}) > dispose`);
26920
26922
  disposers.forEach(fn => fn());
26923
+ dropFromCache(cacheKey);
26921
26924
  };
26922
26925
  };
26923
26926
 
@@ -27561,7 +27564,7 @@ const liveSubChannels = (params, callback, config) => {
27561
27564
  data: result ? merge(subChannels, result) : subChannels,
27562
27565
  };
27563
27566
  responder(snapshot);
27564
- }, queryOptions(policy));
27567
+ }, queryOptions(policy, CACHE_SHORTEN_LIFESPAN));
27565
27568
  };
27566
27569
  disposers.push(onSubChannelCreated(realtimeRouter('onCreate')), onSubChannelDeleted(realtimeRouter('onDelete')), onSubChannelFetched(realtimeRouter('onFetch')), onSubChannelUpdated(realtimeRouter('onUpdate')));
27567
27570
  onFetch();
@@ -27707,7 +27710,7 @@ const liveMessages = (params, callback, config) => {
27707
27710
  }
27708
27711
  pushToCache(cacheKey, data);
27709
27712
  responder(data);
27710
- }, queryOptions(policy));
27713
+ }, queryOptions(policy, CACHE_SHORTEN_LIFESPAN));
27711
27714
  };
27712
27715
  disposers.push(onMessageFetched(realtimeRouter()), onMessageCreated(realtimeRouter()), onMessageUpdated(realtimeRouter()), onMessageDeleted(realtimeRouter()), onMessageFlagged(realtimeRouter()), onMessageUnflagged(realtimeRouter()), onMessageFlagCleared(realtimeRouter()), onMessageReactionAdded(realtimeRouter()), onMessageReactionRemoved(realtimeRouter()));
27713
27716
  onFetch();
@@ -28262,13 +28265,14 @@ const liveCommunities = (params, callback, config) => {
28262
28265
  }
28263
28266
  pushToCache(cacheKey, data);
28264
28267
  responder(data);
28265
- }, queryOptions(policy));
28268
+ }, queryOptions(policy, CACHE_SHORTEN_LIFESPAN));
28266
28269
  };
28267
28270
  disposers.push(onCommunityCreated(realtimeRouter()), onCommunityDeleted(realtimeRouter()), onCommunityUpdated(realtimeRouter()), onCommunityJoined(realtimeRouter()), onCommunityLeft(realtimeRouter()), onCommunityUserChanged(realtimeRouter()));
28268
28271
  onFetch();
28269
28272
  return () => {
28270
28273
  log(`liveCommunities(tmpid: ${timestamp}) > dispose`);
28271
28274
  disposers.forEach(fn => fn());
28275
+ dropFromCache(cacheKey);
28272
28276
  };
28273
28277
  };
28274
28278
 
@@ -29745,13 +29749,14 @@ const livePosts = (params, callback, config) => {
29745
29749
  }
29746
29750
  pushToCache(cacheKey, data);
29747
29751
  responder(data);
29748
- }, queryOptions(policy));
29752
+ }, queryOptions(policy, CACHE_SHORTEN_LIFESPAN));
29749
29753
  };
29750
29754
  disposers.push(onPostCreated(realtimeRouter('onCreate')), onPostApproved(realtimeRouter('onApproved')), onPostDeclined(realtimeRouter('onDeclined')), onPostDeleted(realtimeRouter('onDelete')), onPostUpdated(realtimeRouter('onUpdate')), onPostFlagged(realtimeRouter('onFlagged')), onPostUnflagged(realtimeRouter('onUnflagged')), onPostReactionAdded(realtimeRouter('onReactionAdded')), onPostReactionRemoved(realtimeRouter('onReactionRemoved')));
29751
29755
  onFetch();
29752
29756
  return () => {
29753
29757
  log(`livePosts(tmpid: ${timestamp}) > dispose`);
29754
29758
  disposers.forEach(fn => fn());
29759
+ dropFromCache(cacheKey);
29755
29760
  };
29756
29761
  };
29757
29762
 
@@ -29958,13 +29963,14 @@ const liveComments = (params, callback, config) => {
29958
29963
  }
29959
29964
  pushToCache(cacheKey, data);
29960
29965
  responder(data);
29961
- }, queryOptions(policy));
29966
+ }, queryOptions(policy, CACHE_SHORTEN_LIFESPAN));
29962
29967
  };
29963
29968
  disposers.push(onCommentCreated(realtimeRouter('onCreate')), onCommentUpdated(realtimeRouter('onUpdate')), onCommentDeleted(realtimeRouter('onDelete')), onCommentFlagged(realtimeRouter('onFlagged')), onCommentUnflagged(realtimeRouter('onUnflagged')), onCommentReactionAdded(realtimeRouter('onReactionAdded')), onCommentReactionRemoved(realtimeRouter('onReactionRemoved')));
29964
29969
  onFetch();
29965
29970
  return () => {
29966
29971
  log(`liveComments(tmpid: ${timestamp}) > dispose`);
29967
29972
  disposers.forEach(fn => fn());
29973
+ dropFromCache(cacheKey);
29968
29974
  };
29969
29975
  };
29970
29976
 
package/dist/index.esm.js CHANGED
@@ -81,8 +81,8 @@ const PostContentType = Object.freeze({
81
81
 
82
82
  function getVersion() {
83
83
  try {
84
- // the string ''v0.0.1-beta.42.1-esm'' should be replaced by actual value by @rollup/plugin-replace
85
- return 'v0.0.1-beta.42.1-esm';
84
+ // the string ''v0.0.1-beta.42.2-esm'' should be replaced by actual value by @rollup/plugin-replace
85
+ return 'v0.0.1-beta.42.2-esm';
86
86
  }
87
87
  catch (error) {
88
88
  return '__dev__';
@@ -90,11 +90,22 @@ function getVersion() {
90
90
  }
91
91
  const VERSION = getVersion();
92
92
 
93
+ const COLLECTION_DEFAULT_PAGINATION_LIMIT = 5;
94
+ const COLLECTION_DEFAULT_CACHING_POLICY = 'cache_then_server';
95
+ const ENABLE_CACHE_MESSAGE = 'For using Live Collection feature you need to enable Cache!';
96
+ const LIVE_OBJECT_ENABLE_CACHE_MESSAGE = 'For using Live Object feature you need to enable Cache!';
97
+ const UNSYNCED_OBJECT_CACHED_AT_MESSAGE = 'Observing unsynced object is not supported by Live Object.';
98
+ const UNSYNCED_OBJECT_CACHED_AT_VALUE = -5;
99
+ const SECOND = 1000;
100
+ const MINUTE = 60 * SECOND;
101
+ const ACCESS_TOKEN_WATCHER_INTERVAL = 10 * MINUTE;
102
+
93
103
  // cache constants
94
104
  const CACHE_KEY_GET = 'get';
95
105
  const CACHE_KEY_TOMBSTONE = 'dead';
96
- const CACHE_LIFESPAN = 1 * 60 * 1000; // 1 minute
97
- const CACHE_LIFESPAN_TOMBSTONE = 3 * 60 * 1000; // 3 minutes
106
+ const CACHE_SHORTEN_LIFESPAN = 2 * SECOND;
107
+ const CACHE_LIFESPAN = 1 * MINUTE; // 1 minute
108
+ const CACHE_LIFESPAN_TOMBSTONE = 3 * MINUTE; // 3 minutes
98
109
  /**
99
110
  * Shallow-clones an object and sort its keys
100
111
  *
@@ -20367,15 +20378,6 @@ const getFeedSettings = async () => {
20367
20378
  }));
20368
20379
  };
20369
20380
 
20370
- const COLLECTION_DEFAULT_PAGINATION_LIMIT = 5;
20371
- const COLLECTION_DEFAULT_CACHING_POLICY = 'cache_then_server';
20372
- const ENABLE_CACHE_MESSAGE = 'For using Live Collection feature you need to enable Cache!';
20373
- const LIVE_OBJECT_ENABLE_CACHE_MESSAGE = 'For using Live Object feature you need to enable Cache!';
20374
- const UNSYNCED_OBJECT_CACHED_AT_MESSAGE = 'Observing unsynced object is not supported by Live Object.';
20375
- const UNSYNCED_OBJECT_CACHED_AT_VALUE = -5;
20376
- const MINUTE = 60 * 1000;
20377
- const ACCESS_TOKEN_WATCHER_INTERVAL = 10 * MINUTE;
20378
-
20379
20381
  // TODO: find a way to uniquely identify the device
20380
20382
  /** @hidden */
20381
20383
  const getDeviceId = () => {
@@ -26897,13 +26899,14 @@ const liveChannels = (params, callback, config) => {
26897
26899
  }
26898
26900
  pushToCache(cacheKey, data);
26899
26901
  responder(data);
26900
- }, queryOptions(policy));
26902
+ }, queryOptions(policy, CACHE_SHORTEN_LIFESPAN));
26901
26903
  };
26902
26904
  disposers.push(onChannelCreated(realtimeRouter()), onChannelDeleted(realtimeRouter()), onChannelUpdated(realtimeRouter()), onChannelMuted(realtimeRouter()), onChannelJoined(realtimeRouter()), onChannelLeft(realtimeRouter()), onChannelMemberAdded(realtimeRouter()), onChannelMemberRemoved(realtimeRouter()), onMessageCreated(() => null));
26903
26905
  onFetch();
26904
26906
  return () => {
26905
26907
  log(`liveChannels(tmpid: ${timestamp}) > dispose`);
26906
26908
  disposers.forEach(fn => fn());
26909
+ dropFromCache(cacheKey);
26907
26910
  };
26908
26911
  };
26909
26912
 
@@ -27547,7 +27550,7 @@ const liveSubChannels = (params, callback, config) => {
27547
27550
  data: result ? merge(subChannels, result) : subChannels,
27548
27551
  };
27549
27552
  responder(snapshot);
27550
- }, queryOptions(policy));
27553
+ }, queryOptions(policy, CACHE_SHORTEN_LIFESPAN));
27551
27554
  };
27552
27555
  disposers.push(onSubChannelCreated(realtimeRouter('onCreate')), onSubChannelDeleted(realtimeRouter('onDelete')), onSubChannelFetched(realtimeRouter('onFetch')), onSubChannelUpdated(realtimeRouter('onUpdate')));
27553
27556
  onFetch();
@@ -27693,7 +27696,7 @@ const liveMessages = (params, callback, config) => {
27693
27696
  }
27694
27697
  pushToCache(cacheKey, data);
27695
27698
  responder(data);
27696
- }, queryOptions(policy));
27699
+ }, queryOptions(policy, CACHE_SHORTEN_LIFESPAN));
27697
27700
  };
27698
27701
  disposers.push(onMessageFetched(realtimeRouter()), onMessageCreated(realtimeRouter()), onMessageUpdated(realtimeRouter()), onMessageDeleted(realtimeRouter()), onMessageFlagged(realtimeRouter()), onMessageUnflagged(realtimeRouter()), onMessageFlagCleared(realtimeRouter()), onMessageReactionAdded(realtimeRouter()), onMessageReactionRemoved(realtimeRouter()));
27699
27702
  onFetch();
@@ -28248,13 +28251,14 @@ const liveCommunities = (params, callback, config) => {
28248
28251
  }
28249
28252
  pushToCache(cacheKey, data);
28250
28253
  responder(data);
28251
- }, queryOptions(policy));
28254
+ }, queryOptions(policy, CACHE_SHORTEN_LIFESPAN));
28252
28255
  };
28253
28256
  disposers.push(onCommunityCreated(realtimeRouter()), onCommunityDeleted(realtimeRouter()), onCommunityUpdated(realtimeRouter()), onCommunityJoined(realtimeRouter()), onCommunityLeft(realtimeRouter()), onCommunityUserChanged(realtimeRouter()));
28254
28257
  onFetch();
28255
28258
  return () => {
28256
28259
  log(`liveCommunities(tmpid: ${timestamp}) > dispose`);
28257
28260
  disposers.forEach(fn => fn());
28261
+ dropFromCache(cacheKey);
28258
28262
  };
28259
28263
  };
28260
28264
 
@@ -29731,13 +29735,14 @@ const livePosts = (params, callback, config) => {
29731
29735
  }
29732
29736
  pushToCache(cacheKey, data);
29733
29737
  responder(data);
29734
- }, queryOptions(policy));
29738
+ }, queryOptions(policy, CACHE_SHORTEN_LIFESPAN));
29735
29739
  };
29736
29740
  disposers.push(onPostCreated(realtimeRouter('onCreate')), onPostApproved(realtimeRouter('onApproved')), onPostDeclined(realtimeRouter('onDeclined')), onPostDeleted(realtimeRouter('onDelete')), onPostUpdated(realtimeRouter('onUpdate')), onPostFlagged(realtimeRouter('onFlagged')), onPostUnflagged(realtimeRouter('onUnflagged')), onPostReactionAdded(realtimeRouter('onReactionAdded')), onPostReactionRemoved(realtimeRouter('onReactionRemoved')));
29737
29741
  onFetch();
29738
29742
  return () => {
29739
29743
  log(`livePosts(tmpid: ${timestamp}) > dispose`);
29740
29744
  disposers.forEach(fn => fn());
29745
+ dropFromCache(cacheKey);
29741
29746
  };
29742
29747
  };
29743
29748
 
@@ -29944,13 +29949,14 @@ const liveComments = (params, callback, config) => {
29944
29949
  }
29945
29950
  pushToCache(cacheKey, data);
29946
29951
  responder(data);
29947
- }, queryOptions(policy));
29952
+ }, queryOptions(policy, CACHE_SHORTEN_LIFESPAN));
29948
29953
  };
29949
29954
  disposers.push(onCommentCreated(realtimeRouter('onCreate')), onCommentUpdated(realtimeRouter('onUpdate')), onCommentDeleted(realtimeRouter('onDelete')), onCommentFlagged(realtimeRouter('onFlagged')), onCommentUnflagged(realtimeRouter('onUnflagged')), onCommentReactionAdded(realtimeRouter('onReactionAdded')), onCommentReactionRemoved(realtimeRouter('onReactionRemoved')));
29950
29955
  onFetch();
29951
29956
  return () => {
29952
29957
  log(`liveComments(tmpid: ${timestamp}) > dispose`);
29953
29958
  disposers.forEach(fn => fn());
29959
+ dropFromCache(cacheKey);
29954
29960
  };
29955
29961
  };
29956
29962