Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/services/api-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1050,9 +1050,8 @@ export async function handleGetProfileSnapshot(changelogId: string): Promise<Api
}
}

export async function handleRefreshProfile(userId?: string): Promise<ApiResponse<any>> {
export async function handleRefreshProfile(_userId?: string): Promise<ApiResponse<any>> {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected any. Specify a different type


The any type can sometimes leak into your codebase. TypeScript compiler skips the type checking of the any typed variables, so it creates a potential safety hole, and source of bugs in your codebase. We recommend using unknown or never type variable.

try {
const { getTags } = await import("./tags.js");
const { userPromptManager } = await import("./user-prompt/user-prompt-manager.js");
const unanalyzedCount = userPromptManager.countUnanalyzedForUserLearning();
return {
Expand Down
2 changes: 1 addition & 1 deletion src/services/user-prompt/user-prompt-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type DatabaseType = Database;
const USER_PROMPTS_DB_NAME = "user-prompts.db";

function escapeLikePattern(value: string): string {
return value.replace(/[\\%_]/g, (char) => String.raw`\${char}`);
return value.replace(/[\\%_]/g, (char) => String.raw`\\${char}`);
}

export interface UserPrompt {
Expand Down
4 changes: 2 additions & 2 deletions tests/embedding-internals.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ describe("EmbeddingService singleton and internals", () => {

it("reuses in-progress initPromise on second warmup call", () => {
// First call sets initPromise
const promise1 = service.warmup();
service.warmup();
// Second call returns same promise
const promise2 = service.warmup();
service.warmup();
expect((service as any).initPromise).not.toBeNull();
// Clean up
(service as any).initPromise = null;
Expand Down
5 changes: 2 additions & 3 deletions tests/memory-conflicts.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { afterEach, describe, it, expect, vi, beforeEach } from "vitest";
import { describe, it, expect, vi, beforeEach } from "vitest";

vi.mock("../src/services/sqlite/shard-manager.js", () => ({
shardManager: {
Expand Down Expand Up @@ -65,7 +65,6 @@ import {
import { shardManager } from "../src/services/sqlite/shard-manager.js";
import { connectionManager } from "../src/services/sqlite/connection-manager.js";
import { vectorSearch } from "../src/services/sqlite/vector-search.js";
import { embeddingService } from "../src/services/embedding.js";

function makeMockDb(
options: {
Expand Down Expand Up @@ -96,7 +95,7 @@ function makeMockDb(
};
}
return {
all: vi.fn().mockImplementation((...args: any[]) => {
all: vi.fn().mockImplementation(() => {
if (sql.includes("memories_fts MATCH")) return ftsMemories;
if (sql.includes("content LIKE") || sql.includes("AND id !=")) return likeMemories;
if (sql.includes("memory_conflicts") && sql.includes("LEFT JOIN")) return conflictRows;
Expand Down
Loading