Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task
eikowagenknecht opened this issue Dec 6, 2024 · 5 comments · Fixed by #12966
Closed
1 task
Labels
feat: content layer Related to the Content Layer feature (scope)

Comments

@eikowagenknecht
Copy link

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.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Dec 6, 2024
@ascorbic
Copy link
Contributor

ascorbic commented Jan 10, 2025

Hi. I can't reproduce this in the currrent version. As you didn't share your own reproduction I can't tell if this has been fixed or not. Can you see if it's still happening, and if so then please share a repro.

@ascorbic ascorbic added the needs repro Issue needs a reproduction label Jan 10, 2025
Copy link
Contributor

Hello @eikowagenknecht. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs repro will be closed if they have no activity within 3 days.

@github-actions github-actions bot removed the needs triage Issue needs to be triaged label Jan 10, 2025
@eikowagenknecht
Copy link
Author

@ascorbic I didn't create another reproduction since the original example repository (which I linked) already shows this behaviour. Here's a screencast. Please note the duplicate blog article at the end of it.

3

@ascorbic
Copy link
Contributor

OK the part that was unclear was that you were referring to changing the slug in frontmatter, because the entries in the example don't have them. I was changing it with the filename, which was why I couldn't reproduce it.

@ascorbic ascorbic added feat: content layer Related to the Content Layer feature (scope) and removed needs repro Issue needs a reproduction labels Jan 10, 2025
@eikowagenknecht
Copy link
Author

No worries, I‘m glad the screencast cleared it up. Thanks‘s for the prompt resolution / PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: content layer Related to the Content Layer feature (scope)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants