discourse/spec
Andrei Prigorshnev 932a2fe419
FIX: PG::StringDataRightTruncation when linking posts (#13134)
Users who use encoded slugs on their sites sometimes run into 500 error when pasting a link to another topic in a post. The problem happens when generating a backward "reflection" link that would appear in a linked topic. Link URL restricted on the database level to 500 chars in length. At first glance, it should work since we have a restriction on topic title length.

But it doesn't work when a site uses encoded slugs, like here (take a look at the URL). The link to a topic, in this case, can be much longer than 500 characters.

By the way, an error happens only when generating a "reflection" link and doesn't happen with a direct link, we truncate that link. It works because, in this case, the original long link is still present in the post body and can be used for navigation. But we can't do the same for backward "reflection" links (without rewriting their implementation), the whole link must be saved to the database.

The simplest and cleanest solution will be just to remove the restriction on the database level. Abuse is impossible here since we are already protected by the restriction on topic title length. There aren’t performance benefits in using length-constrained columns in Postgres, in fact, length-constrained columns need a few extra CPU cycles to check the length when storing data.
2021-06-02 15:27:04 +04:00
..
components FIX: Split link watched words from replace (#13196) 2021-06-02 15:36:49 +10:00
fabricators FEATURE: Improve group email settings UI (#13083) 2021-05-28 09:28:18 +10:00
fixtures FIX: return an empty result if response from Amazon is missing expected attributes (#13173) 2021-06-01 16:23:18 -04:00
helpers A11Y: sets the html lang to user's locale when possible (#12007) 2021-02-10 16:12:09 +01:00
import_export FEATURE: Rake task to export groups (#9450) 2020-04-17 14:59:54 -07:00
initializers FEATURE: A low priority filter for the review queue. (#12822) 2021-04-23 15:34:24 -03:00
integration No need to disable rate limiter after running tests (#13093) 2021-05-19 16:04:35 +04:00
integrity FIX: Don't store translated trust level names in anonymous cache (#13224) 2021-06-01 22:11:48 +02:00
jobs FIX: Use a better default for the low_priority_threshold setting. (#13161) 2021-05-26 13:16:16 -03:00
lib FIX: return an empty result if response from Amazon is missing expected attributes (#13173) 2021-06-01 16:23:18 -04:00
mailers FEATURE: Improve group email settings UI (#13083) 2021-05-28 09:28:18 +10:00
models FIX: PG::StringDataRightTruncation when linking posts (#13134) 2021-06-02 15:27:04 +04:00
multisite FEATURE: Use path from existing URL of uploads and optimized images (#13177) 2021-05-27 17:42:25 +02:00
requests DEV: Remove ember_jquery in most situations (#13237) 2021-06-01 15:32:51 -04:00
script/import_scripts DEV: If disabled do not change setting after import (#12142) 2021-02-19 09:33:35 -07:00
serializers DEV: Correct typos and spelling mistakes (#12812) 2021-05-21 11:43:47 +10:00
services FEATURE: Improve group email settings UI (#13083) 2021-05-28 09:28:18 +10:00
support DEV: Absorb onebox gem into core (#12979) 2021-05-26 15:11:35 +05:30
tasks FIX: remove migrate_from_s3 task that silently corrupts data (#11703) 2021-01-17 22:33:29 +01:00
views/omniauth_callbacks FEATURE: Use full page redirection for all external auth methods (#8092) 2019-10-08 12:10:43 +01:00
rails_helper.rb DEV: Absorb onebox gem into core (#12979) 2021-05-26 15:11:35 +05:30
swagger_helper.rb api docs example (#11997) 2021-02-08 10:09:44 -07:00