From 665f0d480044e6ebf0f25eb1d1e6b5cf89530c0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maksym=20Smoli=C5=84ski?= Date: Mon, 29 Jun 2026 10:08:03 +0200 Subject: [PATCH 1/4] RDBC-1082 Fix CustomEntityName test for RavenDB-25738 control-char guard The server now rejects control characters in collection names unconditionally. Align basicChars with the C# CustomEntityName test (no control chars) and drop the obsolete 14-31 skip. --- test/Ported/CustomEntityName.ts | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/test/Ported/CustomEntityName.ts b/test/Ported/CustomEntityName.ts index 0ab5b2f3..afa9a05c 100644 --- a/test/Ported/CustomEntityName.ts +++ b/test/Ported/CustomEntityName.ts @@ -4,18 +4,12 @@ import { assertThat } from "../Utils/AssertExtensions.js"; describe("CustomEntityName", function () { - const getChars = () => { - const basicChars = [...new Array(31).keys()].map(x => { - return String.fromCodePoint(x + 1); - }); - - const extraChars = [ "a", "-", "'", "\"", "\\", "\b", "\f", "\n", "\r", "\t" ]; - - return [...basicChars, ...extraChars]; - }; - const getCharactersToTestWithSpecial = () => { - const basicChars = getChars(); + // RavenDB-25738: the server rejects control characters in a collection name + // unconditionally (the SupportedFeatures opt-out only relaxes document IDs). + // These chars are therefore everything the server allows in a collection name + // and match the C# CustomEntityName test's GetChars(). + const basicChars = [ "a", "-", "'", "\"", "\\", "\b", "\f", "\n", "\r", "\t" ]; const specialChars = [ "Ā", "Ȁ", "Ѐ", "Ԁ", "؀", "܀", "ऀ", "ਅ", "ଈ", "అ", "ഊ", "ข", "ဉ", "ᄍ", "ሎ", "ጇ", "ᐌ", "ᔎ", "ᘀ", "ᜩ", "ᢹ", "ᥤ", "ᨇ" ]; return [...basicChars, ...specialChars]; } @@ -29,11 +23,6 @@ describe("CustomEntityName", function () { const store = await testContext.getDocumentStore(); try { - - if (c.charCodeAt(0) >= 14 && c.charCodeAt(0) <= 31) { - return; - } - { const session = store.openSession(); const car = new Car(); From ef49b945cc27fbf963a73a72b5de26ae836601cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maksym=20Smoli=C5=84ski?= Date: Thu, 9 Jul 2026 17:37:12 +0200 Subject: [PATCH 2/4] RDBC-1082 Add cleanup to delete subscriptions after tests --- test/Ported/Issues/RavenDB_13478.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/Ported/Issues/RavenDB_13478.ts b/test/Ported/Issues/RavenDB_13478.ts index f3d9de94..ef1d9cdd 100644 --- a/test/Ported/Issues/RavenDB_13478.ts +++ b/test/Ported/Issues/RavenDB_13478.ts @@ -36,6 +36,7 @@ describe("RavenDB_13478", function () { let name = await store.subscriptions.create(options); await assertSubscription(store, name, 0); + await store.subscriptions.delete(name); options = { includes: builder => builder.includeAllCounters(), @@ -45,6 +46,7 @@ describe("RavenDB_13478", function () { name = await store.subscriptions.create(options); await assertSubscription(store, name, 0); + await store.subscriptions.delete(name); options = { includes: builder => builder.includeCounter("likes"), @@ -54,10 +56,12 @@ describe("RavenDB_13478", function () { name = await store.subscriptions.create(options); await assertSubscription(store, name, 1); + await store.subscriptions.delete(name); name = await store.subscriptions.create(Product); await assertSubscription(store, name, 2); + await store.subscriptions.delete(name); }); }); From 52b40b913a0c7645dd1d6d38ca8290eb41299d9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maksym=20Smoli=C5=84ski?= Date: Fri, 10 Jul 2026 08:49:20 +0200 Subject: [PATCH 3/4] RDBC-1082 Refactor server version checks to use `isRavenDbServerVersion` utility function --- test/Ported/HttpsTest.ts | 4 ++-- test/Ported/Issues/RavenDB_11440.ts | 2 +- test/Ported/Server/LogsConfigurationTest.ts | 2 +- test/Utils/TestUtil.ts | 4 +++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/test/Ported/HttpsTest.ts b/test/Ported/HttpsTest.ts index 491415bf..084da77b 100644 --- a/test/Ported/HttpsTest.ts +++ b/test/Ported/HttpsTest.ts @@ -1,5 +1,5 @@ import assert from "node:assert" -import { testContext, disposeTestDocumentStore } from "../Utils/TestUtil.js"; +import {testContext, disposeTestDocumentStore, RavenTestContext} from "../Utils/TestUtil.js"; import { CertificateRawData, @@ -280,7 +280,7 @@ async function extractCertificate(certificateRawData: CertificateRawData) { if (entry.path.endsWith(".crt")) { const entryText = await readToEnd(entry); const lines = entryText.split(/\r?\n/); - cert = lines.slice(1, -1).join("\r\n"); + cert = lines.slice(1, RavenTestContext.isRavenDbServerVersion("6.2") ? -1 : -2).join("\r\n"); break; } else { entry.autodrain(); diff --git a/test/Ported/Issues/RavenDB_11440.ts b/test/Ported/Issues/RavenDB_11440.ts index 75585e73..9b6f180b 100644 --- a/test/Ported/Issues/RavenDB_11440.ts +++ b/test/Ported/Issues/RavenDB_11440.ts @@ -9,7 +9,7 @@ import { throwError } from "../../../src/Exceptions/index.js"; import { TimeUtil } from "../../../src/Utility/TimeUtil.js"; import { assertThat } from "../../Utils/AssertExtensions.js"; -(RavenTestContext.is70Server ? describe.skip : describe)("RavenDB_11440", function () { +(RavenTestContext.isRavenDbServerVersion("7.0") ? describe.skip : describe)("RavenDB_11440", function () { let store: IDocumentStore; diff --git a/test/Ported/Server/LogsConfigurationTest.ts b/test/Ported/Server/LogsConfigurationTest.ts index d66a35bb..310d117d 100644 --- a/test/Ported/Server/LogsConfigurationTest.ts +++ b/test/Ported/Server/LogsConfigurationTest.ts @@ -7,7 +7,7 @@ import { import { disposeTestDocumentStore, RavenTestContext, testContext } from "../../Utils/TestUtil.js"; import { assertThat } from "../../Utils/AssertExtensions.js"; -(RavenTestContext.is70Server ? describe.skip : describe)("LogsConfigurationTest", function () { +(RavenTestContext.isRavenDbServerVersion("7.0") ? describe.skip : describe)("LogsConfigurationTest", function () { let store: IDocumentStore; diff --git a/test/Utils/TestUtil.ts b/test/Utils/TestUtil.ts index 88afcb31..9bc731d9 100644 --- a/test/Utils/TestUtil.ts +++ b/test/Utils/TestUtil.ts @@ -135,7 +135,9 @@ class TestSecuredServiceLocator extends RavenServerLocator { export class RavenTestContext extends RavenTestDriver implements IDisposable { - public static is70Server = process.env["RAVENDB_SERVER_VERSION"] >= "7.0"; + public static isRavenDbServerVersion(version: string): boolean { + return process.env["RAVENDB_SERVER_VERSION"] >= version; + } public static isPullRequest = !process.env["RAVEN_License"]; From d0368d9e025a9557e4d2d5332000538d0a374ff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maksym=20Smoli=C5=84ski?= Date: Fri, 10 Jul 2026 09:12:54 +0200 Subject: [PATCH 4/4] RDBC-1082 Update UniqueValuesTest to use `isRavenDbServerVersion` for exception assertion --- test/Ported/UniqueValuesTest.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Ported/UniqueValuesTest.ts b/test/Ported/UniqueValuesTest.ts index 45ab7821..ea423dd0 100644 --- a/test/Ported/UniqueValuesTest.ts +++ b/test/Ported/UniqueValuesTest.ts @@ -1,5 +1,5 @@ import assert from "node:assert" -import { testContext, disposeTestDocumentStore } from "../Utils/TestUtil.js"; +import {testContext, disposeTestDocumentStore, RavenTestContext} from "../Utils/TestUtil.js"; import { IDocumentStore, @@ -167,7 +167,7 @@ describe("UniqueValuesTest", function () { new DeleteCompareExchangeValueOperation("key/2", 0)); assert.fail("should have thrown"); } catch (e) { - assert.strictEqual(e.name, "RavenException") + assert.strictEqual(e.name, RavenTestContext.isRavenDbServerVersion("6.2") ? "RavenException" : "AssertionError") } });