The value too long for type character varying(1000) indicates to me that it’s related to excerpt. This is surprising because technically we limit excerpts at 150 chars, so this case should never happen, at first I thought it was a bug in our excerpt builder but looking at the excerpt code in chat I saw this:
def build_excerpt
# just show the URL if the whole message is a URL, because we cannot excerpt oneboxes
return message if UrlHelper.relaxed_parse(message).is_a?(URI)
# upload-only messages are better represented as the filename
return uploads.first.original_filename if cooked.blank? && uploads.present?
# this may return blank for some complex things like quotes, that is acceptable
PrettyText.excerpt(cooked, EXCERPT_LENGTH, strip_links: true, keep_mentions: true)
end
Quick debugging has shown that we actually never reach PrettyText.excerpt and we stop at the first return. Apparently the ??? is making our code thinks this is a URL:
[1] pry(main)> UrlHelper.relaxed_parse("???\ntest").is_a?(URI)
=> true