Repository navigation
fix(repo): prevent double-write redirect collisions on dependency errors, fix ui - #38627
Merged
wxiaoguang merged 5 commits intoJul 25, 2026
Merged
Conversation
Prevent double-write response header collisions in the issue dependency handler (AddDependency) by checking if a response has already been written before executing the deferred redirect. Signed-off-by: Sudhanshu Singh <sudhanshuwriterblc@gmail.com>
Contributor
|
Thank you very much for catching the bug. Using "defer" in route handler indeed is bad (see the horrible "defer" in NewComment, which was fixed by "Fix various problems (#37077)") So, I think we should refactor the code to be more straightforward: clearly respond what it should do. |
Contributor
…citly Refactor AddDependency and RemoveDependency in issue_dependency.go to call ctx.Redirect explicitly on success and user/validation error paths. This removes the implicit defer block in AddDependency, resolving both response header write collisions on server errors and response hangs on RemoveDependency errors. Signed-off-by: Sudhanshu Singh <sudhanshuwriterblc@gmail.com>
Contributor
|
Will try to refactor the HTML part to use "form-fetch-action", just a moment. |
Contributor
|
Also found a UI regression, fixed together (I will create a separate backport PR for 1.27) Before: After: Backport: |
wxiaoguang
approved these changes
Jul 25, 2026
delvh
approved these changes
Jul 25, 2026
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Jul 27, 2026
* 'main' of https://github.com/go-gitea/gitea: (55 commits) fix(actions): use base branch ref for pull_request_target context (go-gitea#38636) fix(actions): skip already-approved runs in `ApproveRuns` (go-gitea#38653) fix(api): accept fully-qualified refs in contents API (go-gitea#38650) [skip ci] Updated translations via Crowdin chore(build): upload release to Cloudflare R2 (go-gitea#38635) ci: match `# renovate:` markers that trail the value (go-gitea#38640) feat: admin impersonates a user (go-gitea#38614) refactor: git patch apply (go-gitea#38637) fix: orgmode render include path (go-gitea#38642) fix(actions): cancel tasks immediately when the runner stopped reporting (go-gitea#38616) fix(issues): fix label bulk-load key and reduce log noise in LoadLabel (go-gitea#38632) fix(ui): avoid layout shifts in `overflow-menu` and repo filter (go-gitea#37818) chore: generate codemirror languages from `linguist-languages` package (go-gitea#38624) [skip ci] Updated translations via Crowdin fix(actions): improve runner list status sorting, labels and task job links (go-gitea#38586) fix(actions): correctness and hardening fixes (go-gitea#38518) chore: remove goreportcard badge (go-gitea#38630) fix(repo): prevent double-write redirect collisions on dependency errors, fix ui (go-gitea#38627) fix(deps): update module github.com/getkin/kin-openapi to v0.144.0 [security] (go-gitea#38623) chore: update and relax revive naming rules (go-gitea#38615) ...
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Jul 27, 2026
* main: (55 commits) fix(actions): use base branch ref for pull_request_target context (go-gitea#38636) fix(actions): skip already-approved runs in `ApproveRuns` (go-gitea#38653) fix(api): accept fully-qualified refs in contents API (go-gitea#38650) [skip ci] Updated translations via Crowdin chore(build): upload release to Cloudflare R2 (go-gitea#38635) ci: match `# renovate:` markers that trail the value (go-gitea#38640) feat: admin impersonates a user (go-gitea#38614) refactor: git patch apply (go-gitea#38637) fix: orgmode render include path (go-gitea#38642) fix(actions): cancel tasks immediately when the runner stopped reporting (go-gitea#38616) fix(issues): fix label bulk-load key and reduce log noise in LoadLabel (go-gitea#38632) fix(ui): avoid layout shifts in `overflow-menu` and repo filter (go-gitea#37818) chore: generate codemirror languages from `linguist-languages` package (go-gitea#38624) [skip ci] Updated translations via Crowdin fix(actions): improve runner list status sorting, labels and task job links (go-gitea#38586) fix(actions): correctness and hardening fixes (go-gitea#38518) chore: remove goreportcard badge (go-gitea#38630) fix(repo): prevent double-write redirect collisions on dependency errors, fix ui (go-gitea#38627) fix(deps): update module github.com/getkin/kin-openapi to v0.144.0 [security] (go-gitea#38623) chore: update and relax revive naming rules (go-gitea#38615) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AddDependencyandRemoveDependencyto respond correctly