mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-16 07:25:31 +01:00
🪪 fix: Misleading MCP Server Lookup Method Name (#11315)
* 🔧 fix: MCP server ID resolver in access permissions (#11315) - Replaced `findMCPServerById` with `findMCPServerByObjectId` in access permissions route and corresponding tests for improved clarity and consistency in resource identification. * 🔧 refactor: Update MCP server resource access methods to use server name - Replaced instances of `findMCPServerById` with `findMCPServerByServerName` across middleware, database, and test files for improved clarity and consistency in resource identification. - Updated related comments and test cases to reflect the change in method usage. * chore: Increase timeout for Redis update in GenerationJobManager integration tests - Updated the timeout duration from 50ms to 200ms in the GenerationJobManager integration tests to ensure reliable verification of final event data in Redis after emitting the done event.
This commit is contained in:
parent
a8fa85b8e2
commit
f8774983a0
8 changed files with 26 additions and 27 deletions
|
|
@ -134,7 +134,7 @@ export class ServerConfigsDB implements IServerConfigsRepositoryInterface {
|
|||
);
|
||||
}
|
||||
|
||||
const existingServer = await this._dbMethods.findMCPServerById(serverName);
|
||||
const existingServer = await this._dbMethods.findMCPServerByServerName(serverName);
|
||||
let configToSave: ParsedServerConfig = { ...config };
|
||||
|
||||
// Transform user-provided API key config (adds customUserVars and headers)
|
||||
|
|
@ -204,7 +204,7 @@ export class ServerConfigsDB implements IServerConfigsRepositoryInterface {
|
|||
* @returns The parsed server config or undefined if not found. If accessed via agent, consumeOnly will be true.
|
||||
*/
|
||||
public async get(serverName: string, userId?: string): Promise<ParsedServerConfig | undefined> {
|
||||
const server = await this._dbMethods.findMCPServerById(serverName);
|
||||
const server = await this._dbMethods.findMCPServerByServerName(serverName);
|
||||
if (!server) return undefined;
|
||||
|
||||
// Check public access if no userId
|
||||
|
|
|
|||
|
|
@ -584,8 +584,7 @@ describe('GenerationJobManager Integration Tests', () => {
|
|||
};
|
||||
GenerationJobManager.emitDone(streamId, finalEventData as never);
|
||||
|
||||
// Wait for async Redis update
|
||||
await new Promise((resolve) => setTimeout(resolve, 50));
|
||||
await new Promise((resolve) => setTimeout(resolve, 200));
|
||||
|
||||
// Verify finalEvent is in Redis
|
||||
const jobStore = services.jobStore;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue