From 86d353bef80c0d6a88b6a92947b8b5c91739a0a7 Mon Sep 17 00:00:00 2001 From: cnathe Date: Mon, 27 Oct 2025 10:51:41 -0500 Subject: [PATCH 1/4] Issue 53831: check the true assay name length since we append onto the name when creating the assay domains (ex. " Batch Fields") --- api/src/org/labkey/api/exp/property/DomainUtil.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/src/org/labkey/api/exp/property/DomainUtil.java b/api/src/org/labkey/api/exp/property/DomainUtil.java index 5d929ddbbd2..34d0844f3a6 100644 --- a/api/src/org/labkey/api/exp/property/DomainUtil.java +++ b/api/src/org/labkey/api/exp/property/DomainUtil.java @@ -1018,6 +1018,11 @@ public static ValidationException updateDomainDescriptor(GWTDomain Batch Fields") + int actualAssayNameLengthMax = 186; + if ("Assay Design".equalsIgnoreCase(kindName) && domainName.length() > actualAssayNameLengthMax) + return "Value is too long for assay design name, a maximum length of " + actualAssayNameLengthMax + " is allowed. The supplied value, '" + StringUtils.abbreviateMiddle(domainName, "...", 50) + "', was " + domainName.length() + " characters long."; + return null; } From 13bf0f0a24147f9b39a7984ab7c7ece3c5cc61d5 Mon Sep 17 00:00:00 2001 From: cnathe Date: Mon, 27 Oct 2025 11:49:41 -0500 Subject: [PATCH 2/4] Issue 53831: set max assay name length to 150 --- api/src/org/labkey/api/exp/property/DomainUtil.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/api/src/org/labkey/api/exp/property/DomainUtil.java b/api/src/org/labkey/api/exp/property/DomainUtil.java index 34d0844f3a6..74471e3399d 100644 --- a/api/src/org/labkey/api/exp/property/DomainUtil.java +++ b/api/src/org/labkey/api/exp/property/DomainUtil.java @@ -1018,10 +1018,11 @@ public static ValidationException updateDomainDescriptor(GWTDomain Batch Fields") - int actualAssayNameLengthMax = 186; - if ("Assay Design".equalsIgnoreCase(kindName) && domainName.length() > actualAssayNameLengthMax) - return "Value is too long for assay design name, a maximum length of " + actualAssayNameLengthMax + " is allowed. The supplied value, '" + StringUtils.abbreviateMiddle(domainName, "...", 50) + "', was " + domainName.length() + " characters long."; + // Issue 53831: add a specific check for assay name length since we append onto the name when creating the assay domains (ex. " Batch Fields") + // which makes that actual max less than the DB size of 200 + int assayNameLengthMax = 150; + if ("Assay Design".equalsIgnoreCase(kindName) && domainName.length() > assayNameLengthMax) + return "Value is too long for assay design name, a maximum length of " + assayNameLengthMax + " is allowed. The supplied value, '" + StringUtils.abbreviateMiddle(domainName, "...", 50) + "', was " + domainName.length() + " characters long."; return null; } From 0db07e7fe6c0d2f75292c572e7397ae483eed8a3 Mon Sep 17 00:00:00 2001 From: cnathe Date: Mon, 27 Oct 2025 15:13:52 -0500 Subject: [PATCH 3/4] move name length check back to AssayDomainServiceImpl --- api/src/org/labkey/api/exp/property/DomainUtil.java | 6 ------ assay/src/org/labkey/assay/AssayDomainServiceImpl.java | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/src/org/labkey/api/exp/property/DomainUtil.java b/api/src/org/labkey/api/exp/property/DomainUtil.java index 74471e3399d..5d929ddbbd2 100644 --- a/api/src/org/labkey/api/exp/property/DomainUtil.java +++ b/api/src/org/labkey/api/exp/property/DomainUtil.java @@ -1018,12 +1018,6 @@ public static ValidationException updateDomainDescriptor(GWTDomain Batch Fields") - // which makes that actual max less than the DB size of 200 - int assayNameLengthMax = 150; - if ("Assay Design".equalsIgnoreCase(kindName) && domainName.length() > assayNameLengthMax) - return "Value is too long for assay design name, a maximum length of " + assayNameLengthMax + " is allowed. The supplied value, '" + StringUtils.abbreviateMiddle(domainName, "...", 50) + "', was " + domainName.length() + " characters long."; - return null; } diff --git a/assay/src/org/labkey/assay/AssayDomainServiceImpl.java b/assay/src/org/labkey/assay/AssayDomainServiceImpl.java index 5460c1e9589..a91f6a6fcd4 100644 --- a/assay/src/org/labkey/assay/AssayDomainServiceImpl.java +++ b/assay/src/org/labkey/assay/AssayDomainServiceImpl.java @@ -430,6 +430,12 @@ public GWTProtocol saveChanges(GWTProtocol assay, boolean replaceIfExisting) thr if (nameError != null) throw new ValidationException(nameError); + // Issue 53831: add a specific check for assay name length since we append onto the name when creating the assay domains (ex. " Batch Fields") + // which makes that actual max less than the DB size of 200 + int assayNameLengthMax = 150; + if (assay.getName().length() > assayNameLengthMax) + throw new ValidationException("Value is too long for assay design name, a maximum length of " + assayNameLengthMax + " is allowed. The supplied value, '" + StringUtils.abbreviateMiddle(assay.getName(), "...", 50) + "', was " + assay.getName().length() + " characters long."); + if (isNew) { // check for existing assay protocol with the given name before creating From 3ccf9b9cfba0415238ab9f25371a69c83cf98c7f Mon Sep 17 00:00:00 2001 From: cnathe Date: Tue, 28 Oct 2025 09:06:38 -0500 Subject: [PATCH 4/4] typo --- assay/src/org/labkey/assay/AssayDomainServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assay/src/org/labkey/assay/AssayDomainServiceImpl.java b/assay/src/org/labkey/assay/AssayDomainServiceImpl.java index a91f6a6fcd4..0885a3dd071 100644 --- a/assay/src/org/labkey/assay/AssayDomainServiceImpl.java +++ b/assay/src/org/labkey/assay/AssayDomainServiceImpl.java @@ -430,7 +430,7 @@ public GWTProtocol saveChanges(GWTProtocol assay, boolean replaceIfExisting) thr if (nameError != null) throw new ValidationException(nameError); - // Issue 53831: add a specific check for assay name length since we append onto the name when creating the assay domains (ex. " Batch Fields") + // Issue 53831: add a specific check for assay name length since we append onto the name when creating the assay domains (ex. " Batch Fields") // which makes that actual max less than the DB size of 200 int assayNameLengthMax = 150; if (assay.getName().length() > assayNameLengthMax)