forgejo/routers/web
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
..
admin chore: add email blocklist unit test 2025-08-30 09:45:19 +02:00
auth Reject password reset attempts for OAuth2 users without a current password (#9060) 2025-09-12 00:08:29 +02:00
devtest chore(ui): clean up hashbox CSS, small design changes (#7822) 2025-05-25 12:51:27 +02:00
events
explore fix(code-search): fix broken pagination. (#9000) 2025-08-23 13:06:41 +02:00
feed fix: correct release link in feed (#8802) 2025-08-06 17:51:36 +02:00
healthcheck
misc feat: bump the minimum required Git version from 2.0.0 to 2.34.1 (#8328) 2025-06-29 00:44:18 +02:00
moderation feat!: Abusive content reporting (#6977) 2025-05-18 08:05:16 +00:00
org feat: allow any README for .profile (#8798) 2025-09-01 13:58:00 +02:00
repo 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
shared fix: package cleanup rules are not applied when there are more than 200 packages (depends on MAX_RESPONSE_ITEMS) (#9219) 2025-09-09 17:39:35 +02:00
user feat: allow any README for .profile (#8798) 2025-09-01 13:58:00 +02:00
base.go
githttp.go
goget.go
home.go feat: Global 2FA enforcement (#8753) 2025-08-15 10:56:45 +02:00
metrics.go
nodeinfo.go
swagger_json.go
web.go feat: ability to view previous logs for Actions runs that have been retried (#9017) 2025-09-04 22:46:22 +02:00
webfinger.go fix: trim trailing slash in WebFinger OIDC issuer link (#8794) 2025-08-06 14:50:51 +02:00