forgejo/routers/web/repo
Mathieu Fenniak eb21dd17b8 fix: loading action logs on a task that isn't fetched yet, fails when the job is fetched (#9293)
Discovered a regression caused by #9017.

Steps to reproduce:
- Disable the forgejo-runner that will pick up a workflow
- Trigger any workflow to run
- Through the Actions list, click on the new workflow that is pending a runner to fetch it
- You'll be redirected to /user/repo/actions/runs/73/jobs/0/attempt/0  (attempt = 0)
  - The UI will appear normal with the job "Waiting"...
- Startup the forgejo-runner to pick up the workflow
- The UI will begin to have errors:
    - JavaScript promise rejection: JSON.parse: unexpected keyword at line 1 column 1 of the JSON data. Open browser console to see more details. (5)

The cause is that the redirect to `/attempt/0` occurs for a job that hasn't been started, but once the job is started attempt 0 is not a valid attempt and errors will occur when polling for data.  This fix corrects the problem by redirecting to the attempt that will be present (attempt 1) when the job is fetched.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9293
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-09-14 14:30:02 +02:00
..
actions fix: loading action logs on a task that isn't fetched yet, fails when the job is fetched (#9293) 2025-09-14 14:30:02 +02:00
badges chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
flags chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
setting feat: Add converting mirror repos to normal to the API (#8932) 2025-09-14 14:25:05 +02:00
action_aggregator_test.go fix: aggregate deleted team as ghost team (#7987) 2025-05-29 17:45:18 +02:00
activity.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
attachment.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
blame.go blame: count lines without reading blob 2025-06-24 17:36:13 +02:00
branch.go feat: always publish the link to the commit status (#8177) 2025-06-13 12:41:34 +02:00
card.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
cherry_pick.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
code_frequency.go Hide activity contributors, recent commits and code frequrency left tabs if there is no code permission (#34053) 2025-04-01 02:28:02 +02:00
commit.go feat: add tag label to commit list view (#8759) 2025-08-06 14:47:51 +02:00
compare.go fix(ui): compare branches even with pull requests disabled (#8496) 2025-08-03 06:19:45 +02:00
contributors.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
download.go git/commit: re-implement submodules file reader (#8438) 2025-07-15 00:20:00 +02:00
editor.go feat: detect Interlisp sources as text (#8377) 2025-07-02 07:38:46 +02:00
editor_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
find.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
githttp.go fix: do permission check for repository redirect 2025-08-30 09:37:34 +02:00
githttp_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
helper.go feat(build): improve lint-locale-usage further (#8736) 2025-08-27 23:47:34 +02:00
helper_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue.go fix(ui): show participants in mention suggestions in pr review (#8363) 2025-09-04 23:29:34 +02:00
issue_content_history.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
issue_dependency.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_label.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_label_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
issue_lock.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_pin.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_stopwatch.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_timetrack.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_watch.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
main_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
middlewares.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
migrate.go fix: don't allow credentials in migrate/push mirror URL 2025-08-30 08:07:23 +02:00
milestone.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
packages.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
patch.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
projects.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
projects_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
pull.go fix(ui): show participants in mention suggestions in pr review (#8363) 2025-09-04 23:29:34 +02:00
pull_review.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
pull_review_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
recent_commits.go Hide activity contributors, recent commits and code frequrency left tabs if there is no code permission (#34053) 2025-04-01 02:28:02 +02:00
release.go Show if commit is signed in activity feed and unify sha box (#6933) 2025-05-03 10:54:52 +00:00
release_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
render.go feat: detect Interlisp sources as text (#8377) 2025-07-02 07:38:46 +02:00
repo.go feat: always publish the link to the commit status (#8177) 2025-06-13 12:41:34 +02:00
search.go fix(code-search): fix broken pagination. (#9000) 2025-08-23 13:06:41 +02:00
topic.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
treelist.go git/commit: re-implement submodules file reader (#8438) 2025-07-15 00:20:00 +02:00
view.go Update module code.forgejo.org/forgejo/runner/v9 to v11 (forgejo) (#9218) 2025-09-10 22:02:55 +02:00
view_test.go
wiki.go feat: always publish the link to the commit status (#8177) 2025-06-13 12:41:34 +02:00
wiki_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00