Skip to content

[Feature Request]: Delete tag when there are no more articles with that tag #782

@cirosantilli

Description

@cirosantilli

Relevant Scope

Backend specs

Description

Currently there are no test that tags without any articles should be removed I think, but that is visible on /api/tags.

The nicer behavior would be to delete the tags when they are not needed anymore to not clutter the server.

I would just add a test for that under https://github.com/gothinkster/realworld/blob/78c4efa9d40763e5c8f988c297630cdde2194f4d/api/Conduit.postman_collection.json#L1864 or https://github.com/gothinkster/realworld/blob/78c4efa9d40763e5c8f988c297630cdde2194f4d/api/Conduit.postman_collection.json#L2188

Part of the problem is that some of the tests appear to expect a non-clean server, so the full tag list might be unknown, so the tags test doesn't really seem to assert a precise test list.

I recommend that we just drop this philosophy, and instead focus on testing in a clean test environment always, with a controlled tag list.

My initial motivation for this is to help keep a demoserver data limited. But I don't want to cron delete things, I'd rather "delete if there are too many and a new one is added" basis.

Implementing it in SQL properly also requires LOCKing which would serve as a valuable example.

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions