|
| 1 | +import { getAllMockLoggers } from '@sim/testing/mocks/logger.mock' |
1 | 2 | import { describe, expect, it } from 'vitest' |
2 | 3 | import { readFirefliesMcp, searchFirefliesMcp } from '@/lib/sim-search/live/fireflies-mcp' |
3 | 4 | import { readGranolaMcp, searchGranolaMcp } from '@/lib/sim-search/live/granola-mcp' |
@@ -157,6 +158,30 @@ describe('meeting MCP provider wire contracts', () => { |
157 | 158 | await expect(searchFirefliesMcp(client, input)).rejects.toThrow('unsupported') |
158 | 159 | }) |
159 | 160 |
|
| 161 | + it('diagnoses unsupported Fireflies envelopes without logging private values or arbitrary keys', async () => { |
| 162 | + const privateMarker = 'PRIVATE_MEETING_OR_CREDENTIAL' |
| 163 | + const client: ManagedSearchMcpClient = { |
| 164 | + async call() { |
| 165 | + return { |
| 166 | + text: privateMarker.repeat(1000), |
| 167 | + data: { error: privateMarker }, |
| 168 | + result: { items: [{ title: privateMarker }] }, |
| 169 | + ...Object.fromEntries( |
| 170 | + Array.from({ length: 1000 }, (_, index) => [`${privateMarker}_${index}`, privateMarker]) |
| 171 | + ), |
| 172 | + } |
| 173 | + }, |
| 174 | + } |
| 175 | + await expect(searchFirefliesMcp(client, { ...input, query: privateMarker })).rejects.toThrow( |
| 176 | + 'unsupported' |
| 177 | + ) |
| 178 | + const warnings = getAllMockLoggers().flatMap((logger) => logger.warn.mock.calls) |
| 179 | + expect(warnings).toHaveLength(1) |
| 180 | + const serialized = JSON.stringify(warnings) |
| 181 | + expect(serialized).not.toContain(privateMarker) |
| 182 | + expect(serialized.length).toBeLessThan(2000) |
| 183 | + }) |
| 184 | + |
160 | 185 | it('rejects invalid continuation offsets before Fireflies receives a query', async () => { |
161 | 186 | const client = { |
162 | 187 | async call() { |
|
0 commit comments