withastro/astro

Changing slug in a content entry results in duplicate entry until dev server is restarted

eikowagenknecht opened this issue · 0 comments

Astro Info

> *****.de@1.0.0 astro C:\***\***\***.de
> astro "info"

Astro                    v5.0.3
Node                     v20.11.1
System                   Windows (x64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             @astrojs/tailwind
                         @astrojs/mdx
                         @astrojs/react
                         @astrojs/sitemap

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

  1. Start dev server (astro dev)
  2. Change slug of an article
  3. See that both the old and the new slug work and are shown in getCollection powered lists
  4. Optional: Change the slug again and see more duplicates appearing
  5. Restart the dev server
  6. See that only the new slug exists

Happens in the most basic Blog example as well.

What's the expected result?

After changing the slug, the old one should instantly not be available any more (just like it is after a restart of the dev server).

Link to Minimal Reproducible Example

https://stackblitz.com/github/withastro/astro/tree/latest/examples/blog?file=src%2Fcontent%2Fblog%2Ffirst-post.md

Participation

  • I am willing to submit a pull request for this issue.