Release v0.4.1 — Approve Button Fix for Private Repos #7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "release/0.4.1"
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?
Release v0.4.1 — Approve Button Fix for Private Repos
Changes
Summary
The one-click approve button added in v0.4.0 had two issues:
Private repos: The button used
fetch()to call the Forgejo API to check existing reviews. Forgejo 14's stateless CSRF protection doesn't accept session cookies for programmatic fetch requests, so on private repos the API returned 404 and the button was silently removed. Fixed by reading review state from the sidebar DOM instead.Self-approval blocked for admins: The button was unconditionally hidden when the logged-in user was the PR author. Now allows self-approval when the user has merge permission (the
#pull-request-merge-formelement exists).Simplified click handler: Removed the API fallback for getting the commit ID — uses
window.config.pageDataexclusively.Checklist
References
Version: 0.4.1 — Approve Button Fix for Private Repos (Gravity PM ID: 187)
Release task: OP#2784