question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Updating Tags in a blog post doesn't update

See original GitHub issue

When updating a blog post and changing the tags, after change those tags are not visible in the overview page nor in the search (for tags).

Root-Cause

When entering the update blog post page, the blog post is retrieved from the cache rather than the underlying repository. That leads to the problem, that the children are not tracked anymore and therefore don’t get updated.

Test to reproduce

[Fact]
public async Task GivenBlogPostWithTags_WhenLoadingAndDeleting_ThenShouldBeUpdated()
{
    var bp = new BlogPostBuilder().WithTags("tag 1").Build();
    var sut = new CachedRepository<BlogPost>(Repository, new MemoryCache(new MemoryCacheOptions()));
    await sut.StoreAsync(bp);
    var updateBp = new BlogPostBuilder().WithTags("tag 2").Build();
    var bpFromCache = await sut.GetByIdAsync(bp.Id);
    bpFromCache.Update(updateBp);
    await sut.StoreAsync(bpFromCache);

    var bpFromDb = await sut.GetByIdAsync(bp.Id);

    bpFromDb.Tags.Single().Content.Should().Be("tag 2");
}

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
manishtiwari25commented, Aug 2, 2023

can’t test now, because Pomelo.EntityFrameworkCore.MySql doesn’t support EF Core 8, they have opened an issue. I will raise a PR after they release something related to this.

1reaction
manishtiwari25commented, Aug 2, 2023

looks good and I was also thinking the same approach, I will test it in MySQL and let you know, or make changes if needed. thanks for fixing 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Blog Tags not Updating
I have had a few issues with Blog Tags not updating if you change them once the post has been saved. The only...
Read more >
why does tag not update
Some modifications (e.g. change case of a letter) won't be updated at the post or page editor. You should be able to make...
Read more >
WordPress Changes Not Showing? Three Methods to Fix ...
When WordPress is not showing changes right away, it is most likely still displaying a cached version. Learn three ways to fix this...
Read more >
Trouble With Updating META Tags - Blogger Community
If you want to update your blog description, please open https://www.blogger.com dashboard -> Settings tab -> scroll down to "Meta tags" -> ...
Read more >
i can do this all day — so tumblr broke your tags again.
Go to settings > your blog > Hide <blog> from search results. Tab this on. Save, refresh, then tab off. Repost gif.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found