🔀 fix: Endpoint Type Mismatch when Switching Conversations (#1834)

* refactor(useUpdateUserKeysMutation): only invalidate the endpoint whose key is being updated by user

* fix(assistants): await `getUserKeyExpiry` call

* chore: fix spinner loading color

* refactor(initializeClient): make known which endpoint api Key is missing

* fix: prevent an `endpointType` mismatch by making it impossible to assign when the `endpointsConfig` doesn't have a `type` defined, also prefer `getQueryData` call to useQuery in useChatHelpers
This commit is contained in:
Danny Avila 2024-02-19 01:31:38 -05:00 committed by GitHub
parent d1eb7fcfc7
commit 5291d18f38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 28 additions and 18 deletions

View file

@ -1,7 +1,8 @@
// gptPlugins/initializeClient.spec.js
const { PluginsClient } = require('~/app');
const { EModelEndpoint } = require('librechat-data-provider');
const { getUserKey } = require('~/server/services/UserService');
const initializeClient = require('./initializeClient');
const { getUserKey } = require('../../UserService');
const { PluginsClient } = require('~/app');
// Mock getUserKey since it's the only function we want to mock
jest.mock('~/server/services/UserService', () => ({
@ -112,7 +113,7 @@ describe('gptPlugins/initializeClient', () => {
const endpointOption = { modelOptions: { model: 'default-model' } };
await expect(initializeClient({ req, res, endpointOption })).rejects.toThrow(
'API key not provided.',
`${EModelEndpoint.openAI} API key not provided.`,
);
});