@mastra/redis 1.4.5 → 1.4.6-alpha.0

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.
@@ -3,7 +3,7 @@ name: mastra-redis
3
3
  description: Documentation for @mastra/redis. Use when working with @mastra/redis APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/redis"
6
- version: "1.4.5"
6
+ version: "1.4.6-alpha.0"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.4.5",
2
+ "version": "1.4.6-alpha.0",
3
3
  "package": "@mastra/redis",
4
4
  "exports": {},
5
5
  "modules": {}
package/dist/index.cjs CHANGED
@@ -596,15 +596,14 @@ var StoreMemoryRedis = class extends _mastra_core_storage.MemoryStorage {
596
596
  perPage: perPageForResponse,
597
597
  hasMore: false
598
598
  };
599
+ const perThreadIds = await Promise.all(threadIds.map((tid) => this.client.zRange(getThreadMessagesKey(tid), 0, -1)));
599
600
  const allMessageIdsWithThreads = [];
600
- for (const tid of threadIds) {
601
- const threadMessagesKey = getThreadMessagesKey(tid);
602
- const msgIds = await this.client.zRange(threadMessagesKey, 0, -1);
603
- for (const mid of msgIds) allMessageIdsWithThreads.push({
601
+ threadIds.forEach((tid, i) => {
602
+ for (const mid of perThreadIds[i]) allMessageIdsWithThreads.push({
604
603
  threadId: tid,
605
604
  messageId: mid
606
605
  });
607
- }
606
+ });
608
607
  if (allMessageIdsWithThreads.length === 0) return {
609
608
  messages: [],
610
609
  total: 0,