forgejo/routers
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
..
api feat: Add converting mirror repos to normal to the API (#8932) 2025-09-14 14:25:05 +02:00
common feat: add tracing logs after process is complete (#8680) 2025-07-26 05:44:58 +02:00
install chore: use sharp to generate images (#7512) 2025-04-11 15:12:50 +00:00
private feat(log): better parseable and configurable ssh-logs (#9056) 2025-09-11 18:59:24 +02:00
utils [PORT] drop utils.IsExternalURL (and expand IsRiskyRedirectURL tests) (#3167) 2024-04-15 13:03:08 +00:00
web 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
init.go Add ActivityPub Person follow from distant (#8720) 2025-08-03 11:55:01 +02:00