Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): message search keeps results when a short non-Latin word differs in case #30332

MergedMarcoDotIO(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/30332/headmerged by maria-rcks View on GitHub

Showing 2 changed files with 107 additions and 3 deletions.

x
0 of 2 viewed, 2 left
80 additions and 1 deletionapps/server/src/orchestration-v2/ThreadSearch.test.tsModified
View file
@@ -270,7 +270,7 @@
for (const match of ['"needle"', null]) {
const plan = yield* sql<{
readonly detail: string;
- }>`EXPLAIN QUERY PLAN ${ThreadSearch.messageHitsQuery(sql, { match, substrings: "[]", projectId: null, excludedThreadIds: "[]" })}`;
+ }>`EXPLAIN QUERY PLAN ${ThreadSearch.messageHitsQuery(sql, { match, substrings: "[]", shortSpellings: "[]", projectId: null, excludedThreadIds: "[]" })}`;
assert.isFalse(
plan.some((row) => row.detail.includes("TEMP B-TREE")),
plan.map((row) => row.detail).join("\n"),
@@ -732,6 +732,85 @@
});
​
+it.effect.each([true, false])(
+ "ThreadSearch narrows short words outside ASCII before the hit limit (indexed: %s)",
+ (indexed) =>
+ Effect.gen(function* () {
+ const projections = yield* ProjectionStore.ProjectionStoreV2;
+ const search = yield* ThreadSearch.ThreadSearch;
+ const sql = yield* SqlClient.SqlClient;
+ const project = ProjectId.make("project:short-limit");
+ const older = ThreadId.make("thread:short-older");
+ const newer = ThreadId.make("thread:short-newer");
+ yield* createProject(project);
+ yield* Effect.forEach(
+ [
+ thread(older, project),
+ message(older, "older", "user", "В логах ошибка"),
+ thread(newer, project),