mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-22 11:19:39 +03:00
Avoid changing updated_by for some API scenarios #4487
Open
opened 2026-02-05 08:59:00 +03:00 by OVERLORD
·
6 comments
No Branch/Tag Specified
development
l10n_development
release
v25-12
llm_only
vectors
v25-11
docker_env
drawio_rendering
user_permissions
ldap_host_failover
svg_image
prosemirror
captcha_example
fix/video-export
v25.12.7
v25.12.6
v25.12.5
v25.12.4
v25.12.3
v25.12.2
v25.12.1
v25.12
v25.11.6
v25.11.5
v25.11.4
v24.11.4
v25.11.3
v25.11.2
v25.11.1
v25.11
v25.07.3
v25.07.2
v25.07.1
v25.07
v25.05.2
v25.05.1
v25.05
v25.02.5
v25.02.4
v25.02.3
v25.02.2
v25.02.1
v25.02
v24.12.1
v24.12
v24.10.3
v24.10.2
v24.10.1
v24.10
v24.05.4
v24.05.3
v24.05.2
v24.05.1
v24.05
v24.02.3
v24.02.2
v24.02.1
v24.02
v23.12.3
v23.12.2
v23.12.1
v23.12
v23.10.4
v23.10.3
v23.10.2
v23.10.1
v23.10
v23.08.3
v23.08.2
v23.08.1
v23.08
v23.06.2
v23.06.1
v23.06
v23.05.2
v23.05.1
v23.05
v23.02.3
v23.02.2
v23.02.1
v23.02
v23.01.1
v23.01
v22.11.1
v22.11
v22.10.2
v22.10.1
v22.10
v22.09.1
v22.09
v22.07.3
v22.07.2
v22.07.1
v22.07
v22.06.2
v22.06.1
v22.06
v22.04.2
v22.04.1
v22.04
v22.03.1
v22.03
v22.02.3
v22.02.2
v22.02.1
v22.02
v21.12.5
v21.12.4
v21.12.3
v21.12.2
v21.12.1
v21.12
v21.11.3
v21.11.2
v21.11.1
v21.11
v21.10.3
v21.10.2
v21.10.1
v21.10
v21.08.6
v21.08.5
v21.08.4
v21.08.3
v21.08.2
v21.08.1
v21.08
v21.05.4
v21.05.3
v21.05.2
v21.05.1
v21.05
v21.04.6
v21.04.5
v21.04.4
v21.04.3
v21.04.2
v21.04.1
v21.04
v0.31.8
v0.31.7
v0.31.6
v0.31.5
v0.31.4
v0.31.3
v0.31.2
v0.31.1
v0.31.0
v0.30.7
v0.30.6
v0.30.5
v0.30.4
v0.30.3
v0.30.2
v0.30.1
v0.30.0
v0.29.3
v0.29.2
v0.29.1
v0.29.0
v0.28.3
v0.28.2
v0.28.1
v0.28.0
v0.27.5
v0.27.4
v0.27.3
v0.27.2
v0.27.1
v0.27
v0.26.4
v0.26.3
v0.26.2
v0.26.1
v0.26.0
v0.25.5
v0.25.4
v0.25.3
v0.25.2
v0.25.1
v0.25.0
v0.24.3
v0.24.2
v0.24.1
v0.24.0
v0.23.2
v0.23.1
v0.23.0
v0.22.0
v0.21.0
v0.20.3
v0.20.2
v0.20.1
v0.20.0
v0.19.0
v0.18.5
v0.18.4
v0.18.3
v0.18.2
v0.18.1
v0.18.0
v0.17.4
v0.17.3
v0.17.2
v0.17.1
v0.17.0
v0.16.3
v0.16.2
v0.16.1
v0.16.0
v0.15.3
v0.15.2
v0.15.1
v0.15.0
v0.14.3
v0.14.2
v0.14.1
v0.14.0
v0.13.1
v0.13.0
v0.12.2
v0.12.1
v0.12.0
v0.11.2
v0.11.1
v0.11.0
v0.10.0
v0.9.3
v0.9.2
v0.9.1
v0.9.0
v0.8.2
v0.8.1
v0.8.0
v0.7.6
v0.7.5
v0.7.4
v0.7.3
0.7.2
v.0.7.1
v0.7.0
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.0
Labels
Clear labels
🎨 Design
📖 Docs Update
🐛 Bug
🐛 Bug
:cat2:🐈 Possible duplicate
💿 Database
☕ Open to discussion
💻 Front-End
🐕 Support
🚪 Authentication
🌍 Translations
🔌 API Task
🏭 Back-End
⛲ Upstream
🔨 Feature Request
🛠️ Enhancement
🛠️ Enhancement
🛠️ Enhancement
❤️ Happy feedback
🔒 Security
🔍 Pending Validation
💆 UX
📝 WYSIWYG Editor
🌔 Out of scope
🔩 API Request
:octocat: Admin/Meta
🖌️ View Customization
❓ Question
🚀 Priority
🛡️ Blocked
🚚 Export System
♿ A11y
🔧 Maintenance
> Markdown Editor
pull-request
Mirrored from GitHub Pull Request
No Label
🔩 API Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/BookStack#4487
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jaapert on GitHub (Feb 26, 2024).
API Endpoint or Feature
Changes to a book/ chapter/ page via the API (i.e. PUT /books/{id}) result in an updated update_at and updated_by field. It would be beneficial to avoid this for some automated processes because this confuses users (a resource seems to be unintentionally changed without them knowing why).
For most API calls this is exactly what should happen, but it should be possible to avoid this in specific circumstances. I see three possible ways:
Use-Case
The current automatic updated_at and updated_by behavior prevents any process from doing its work transparently,
Additional context
No response
@ssddanbrown commented on GitHub (Feb 26, 2024):
Thanks for the suggestion @jaapert.
This is a little related to #1777.
Personally, I'm not too keen on adding complexity to support edge cases where you want to hide activity/actions like this.
I'm not totally sure on your scenario, and the use of the "dynamic tags" referenced, but it may be possible to move your dynamic content to its own page, then make use of include tags to import that content into the original page. Then you can focus your API updates on the new "dynamic content" page, to allow that change to be reflected when viewing the original page, without that update affecting the activity of the original page at all.
@jaapert commented on GitHub (Feb 26, 2024):
Thanks for your quick reply and I understand your point about being hesitant to adding complexity to support all kinds of minor edge cases.
You referenced #1777 already; and it also is a little related to #4416. Given the references I don't think this really is an edge case; since everybody using the API for any automation/ bulk related tasks would potentially benefit from this.
About my case of dynamic tags: I use this to keep track of book versions and I use the tag value in a custom PDF export theme. So every page edit fires a webhook, which checks the current version tag, increments it and pushes the incremented version tag back to the book. This is for my use case needed because I need version numbers for entire (exported) books instead of page specific revision ids. This is indeed a corner case, but I imagine many more use cases for generating dynamic tags (creating tags on the fly, based on automated content analysis for one example; I'm sure there are many more). I consider the tag system one of BookStacks powers; adding flexibility to it and creating opportunity to integrate with other (custom) tools as well. It is just a bummer that using it this way confuses the end user by changing the 'Updated by' field in the UI to something unexpected (from the end users perspective).
I explicitly tried to formulate my proposal to support not only my specific corner case; but to be usable for everybody who wants to use automation to interact with their books. I think this adds flexibility for the tool as a whole; much broader than just my specific case.
Hope this gives some context and a possibility for reconsideration ;)
Thanks again!
@ssddanbrown commented on GitHub (Feb 27, 2024):
Ah, I thought we had a similar request (#4416) but could not find it earlier. I feel that has the same fundamental request as this thread so I'll likely close this off in favor of that existing issue.
To be honest, I don't really fully understand what you're doing, but since you're triggering upon BookStack activity, and wanting to write back into BookStack without activity, it sounds like something well suited for the logical theme system.
Using this you could hook into page edit events, then read/write back to books/pages however you want with full control.
Here's the closest kind of hack I have to-hand, but it does something completely different:
https://www.bookstackapp.com/hacks/autosort-tagged-books/
@hieste commented on GitHub (Feb 27, 2024):
Hello Dan, have same issue. I have a user called translateengine, with an API Token. Everytime somebody change/update/create a page the translate engine translate text, index the result and put into tags. In the updatefiel_user then there is user translateengine. It would be nice if the old user wouldn't be changed.
Stefan
@zoryatix commented on GitHub (Mar 4, 2024):
Just throwing in my 2 cents here. I'm usually using the API user to do bulk changes or automate certain process (like a review function for stale documentation). These things cause a lot of changes and pollutes the recent activity view. I don't think the process or reason really matters here. Recent activity is a visible to all and is great for changes done by actual users. But it loses it purpose when showing changes done by the API user. I as admin would usually look at the audit log in case I need to track changes done by the API account.
If it was possible to filter on recent activity, like we can with the audit log, then that would solve the problem for me at least.
@jaapert commented on GitHub (May 27, 2024):
Hi!
All comments considered, I think it's safe to assume that more users would like to avoid bulk- or other API tasks to pollute the activity tab.
Maybe an easier fix would be to just exclude certain users completely from activity views. I think this fixes most cases, since those API use cases are probably mostly done by dedicated API users. I think a profile (or token) setting 'Hide from activity' would good enough.
What do you think, is this something that can be implemented?
Thanks in advance!