diff --git a/resources/sql/autopatches/20251024.herald.webhookuri.sql b/resources/sql/autopatches/20251024.herald.webhookuri.sql new file mode 100644 index 0000000000..df60f1aae6 --- /dev/null +++ b/resources/sql/autopatches/20251024.herald.webhookuri.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_herald.herald_webhook + MODIFY COLUMN webhookURI LONGTEXT NOT NULL; diff --git a/src/applications/herald/storage/HeraldWebhook.php b/src/applications/herald/storage/HeraldWebhook.php index 0101dbef52..fd71980185 100644 --- a/src/applications/herald/storage/HeraldWebhook.php +++ b/src/applications/herald/storage/HeraldWebhook.php @@ -24,7 +24,7 @@ final class HeraldWebhook self::CONFIG_AUX_PHID => true, self::CONFIG_COLUMN_SCHEMA => array( 'name' => 'text128', - 'webhookURI' => 'text255', + 'webhookURI' => 'text', 'status' => 'text32', 'hmacKey' => 'text32', ), diff --git a/src/applications/herald/xaction/HeraldWebhookURITransaction.php b/src/applications/herald/xaction/HeraldWebhookURITransaction.php index e0162085cb..55c1cb69de 100644 --- a/src/applications/herald/xaction/HeraldWebhookURITransaction.php +++ b/src/applications/herald/xaction/HeraldWebhookURITransaction.php @@ -4,6 +4,7 @@ final class HeraldWebhookURITransaction extends HeraldWebhookTransactionType { const TRANSACTIONTYPE = 'uri'; + private $webhookURIMaxLength = 2048; public function generateOldValue($object) { return $object->getWebhookURI(); @@ -40,17 +41,16 @@ final class HeraldWebhookURITransaction return $errors; } - $max_length = $object->getColumnMaximumByteLength('webhookURI'); foreach ($xactions as $xaction) { $old_value = $this->generateOldValue($object); $new_value = $xaction->getNewValue(); $new_length = strlen($new_value); - if ($new_length > $max_length) { + if ($new_length > $this->webhookURIMaxLength) { $errors[] = $this->newInvalidError( pht( 'Webhook URIs can be no longer than %s characters.', - new PhutilNumber($max_length)), + new PhutilNumber($this->webhookURIMaxLength)), $xaction); }