Skip to content

Update updated_at field when tags are changed #3319

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

Closed
FooB4r opened this issue Mar 9, 2022 · 1 comment
Closed

Update updated_at field when tags are changed #3319

FooB4r opened this issue Mar 9, 2022 · 1 comment
Labels
Milestone

Comments

@FooB4r
Copy link

FooB4r commented Mar 9, 2022

Describe the Bug

The updated_at date in the json response (i.e. /api/pages) is not modified when the last update modifies only tags.
I think it would be more coherent to change this date when the tags are updated.
Moreover the tags are not listed in the list of elements queried (see #2680), therefore we cannot test for modified tags directly.

Steps to Reproduce

  1. Create a page
  2. Change only the tags (in a different commit)
  3. Request the list of pages
    The updated_at date is the creation date instead of the tag modification date.

Expected Behaviour

I expect to have every actions listed in the commits to change the updated_at date. That is :

  • Every content modification
  • Every tag modification

Screenshots or Additional Context

I am using Bookstack v21.05.3.
I found the following related issues

Browser Details

No response

Exact BookStack Version

v21.05.3

PHP Version

No response

Hosting Environment

I unfortunnately do not know any information on the hosting environement.

@FooB4r FooB4r added the 🐛 Bug label Mar 9, 2022
ssddanbrown added a commit that referenced this issue Apr 4, 2022
Decided it's relevant to entity updated_at since tags are now indexed
alongside content.

- Also fixed tags not applied on shelf.
- Also enforced proper page API update validation.
- Adds tests to cover.

For #3319
Fixes #3370
@ssddanbrown ssddanbrown added this to the v22.03.2 milestone Apr 4, 2022
@ssddanbrown
Copy link
Member

Thanks for reporting @FooB4r.

I was on the fence with this once, since this behaviour may come down to opinion due to tags maybe being considered a separate entity in themselves. Could choose either way, update or not update.
That said, since we're now updating the search index for content based on tags, tags could now be considered part of the content hence I agreed It makes sense to update timestamps on tag change.

The functionality has been added in c30a9d3, with testing to cover. This will be part of the next patch release.

@ssddanbrown ssddanbrown modified the milestones: v22.03.2, v22.04 Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants