You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pixelfed/tests/Feature/Hashtag
Ashley 8d72eb62f1 Prevent hashtag slug collisions for distinct tag names
storeHashtags() keyed firstOrCreate on slug, so distinct tags that slugify
to the same base (e.g. #foo·bar vs #foobar) collapsed into one row and
tags reducing to an empty slug aggregated under slug=''. Mirror the
StatusTagsPipeline pattern: skip empty slugs, derive a non-colliding slug
via a counter loop, and key firstOrCreate on the unique name column. The
DB::transaction wrapper, the mb_strlen > 124 skip, and the status_hashtags
linking are unchanged.

Verified in the ddev sqlite harness:
- Against unfixed code the new test fails (2 failed, 1 passed): the two
  distinct tags collapse to one row and a slug='' row is created.
- Against the fix it passes (3 passed, 10 assertions).
- Sibling StatusTagsPipelineHashtagTest + StatusEntityLexerFanoutTest:
  5 passed.
- pint --test: PASS on both files.
1 week ago
..
HashtagSlugCollisionTest.php Prevent hashtag slug collisions for distinct tag names 1 week ago