Updating Tags in a blog post doesn't update
See original GitHub issueWhen 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:
- Created a year ago
- Comments:5 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
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 😃