mcp-teams 0.3.33 → 0.3.34

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.
@@ -1062,6 +1062,7 @@ async function fetchMessages(id, opts) {
1062
1062
  }
1063
1063
 
1064
1064
  const MAX_PAGES = 20;
1065
+ const MESSAGES_ACCOUNT_CHANGED = ACCOUNT_CHANGED_WHILE("messages were read", "reads them as that account");
1065
1066
 
1066
1067
  /** The conversation id chatsvc pages: the conversation, or one channel post's thread. */
1067
1068
  const messagesTarget = (id, threadId) => (threadId ? `${id};messageid=${threadId}` : id);
@@ -1081,9 +1082,18 @@ async function fetchMessagePages(id, { limit, olderThan, includeSystem, threadId
1081
1082
  const linkOf = new Map();
1082
1083
  let counted = 0;
1083
1084
  let pages = 0;
1085
+ // Every page is read as one account: the user of the first page's session (its oid; a 401
1086
+ // can bring the same user a session on another base), with no switch landing meanwhile.
1087
+ const switches = accountSwitches;
1088
+ let readAs; // the oid the pages are read as, from the first session used
1089
+ const sameAccount = (cap) => {
1090
+ if (readAs === undefined) readAs = cap.oid ?? null;
1091
+ if ((cap.oid ?? null) !== readAs) throw new Error(MESSAGES_ACCOUNT_CHANGED);
1092
+ };
1084
1093
  while (path) {
1085
1094
  if (pages === MAX_PAGES) return { raw, linkOf, first, next: path, capped: true, pages };
1086
- const json = await api("chatsvc", path, { ctx });
1095
+ const json = await api("chatsvc", path, { ctx, onCapture: sameAccount });
1096
+ if (switches !== accountSwitches) throw new Error(MESSAGES_ACCOUNT_CHANGED);
1087
1097
  pages++;
1088
1098
  const msgs = json?.messages ?? [];
1089
1099
  for (const m of msgs) {
@@ -2,7 +2,7 @@
2
2
  "manifest_version": 3,
3
3
  "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvoz9Wexl4ZqY9YtEyBZsu/Qi5Ft5EjNUNB8b30wgt3AR8TjXI5UumcPQFBIm7ZfvBsjgrh6tBJlygsgFbZ5cB1EiI+WSz/2Wcqwz4eowKMXXPvGuDGrO+2O2zbSpTG19/MwTljI+g0TLfn8Vkoqd8z9MskKk+vCZjjV0Jk8QjVEdHypgM7H8zTuUM06SO12IIZMdeE3IURzf35zbjlfPPkJiDWoo3wB9nxAvLd57xrQhPUB/lGtCJk9mS3SY+/VwOlG5kJ9WS/RCHXcs5Qs7huIlKIatmFz7YiducvTR3DKBbjqbMTyqHzXkmkUmJRqzsYtgtKcz0C0cjFOt6uNdhwIDAQAB",
4
4
  "name": "mcp-teams bridge",
5
- "version": "0.3.33",
5
+ "version": "0.3.34",
6
6
  "description": "Lets AI assistants (via the mcp-teams MCP server) read and search Microsoft Teams chats, channels and meeting transcripts and, with your explicit confirmation, post messages.",
7
7
  "minimum_chrome_version": "116",
8
8
  "icons": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-teams",
3
- "version": "0.3.33",
3
+ "version": "0.3.34",
4
4
  "description": "MCP server that lets AI assistants work with Microsoft Teams (web) through a Chrome/Edge extension bridge",
5
5
  "keywords": ["mcp", "model-context-protocol", "teams", "microsoft-teams", "microsoft-365", "chat", "claude", "chrome-extension"],
6
6
  "repository": {