forgejo/web_src/js
Mathieu Fenniak d9252f53a3
Some checks are pending
/ release (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
Fix bug where Action UI may occasionally not load logs (#6122)
In the combination of events where the user is viewing an action that is completed (and therefore no interval-based loading of logs is occurring), and `loadJob` is called while `loadJob` is already running (commonly from expanding two log sections back-to-back), the second request for loading would be discarded and never occur.

To fix this, the invocation of `loadJob` keeps track of the log cursors it is attempting to load, and an aborted invocation stores its attempted load.  If `loadJob` succeeds in loading and finds that an attempt was aborted while it was busy, it will reload the data.

Steps to reproduce:
- Open an Action UI that is already "Done".
- Click on two steps in rapid succession to expand their logs.
- (Race condition) As long as the second click is registered while the first log chunk is being loaded, its data won't load.

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...  (**not applicable**)
  - [ ] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [x] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] I do not want this change to show in the release notes.
- [x] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6122
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2024-12-05 18:08:11 +00:00
..
components Fix bug where Action UI may occasionally not load logs (#6122) 2024-12-05 18:08:11 +00:00
features Update web_src/js/features/comp/ComboMarkdownEditor.js 2024-11-28 10:26:12 +00:00
markup Fix race condition in mermaid observer (#32599) 2024-12-03 10:19:22 +01:00
modules Add form field id generation, remove duplicated ids (#30546) 2024-04-22 08:09:00 +02:00
render Use vitest globals (#27102) 2023-09-27 04:37:13 +00:00
standalone [CHORE] Proper chunking for swagger 2024-08-22 15:48:05 +02:00
utils chore: add new lint rules 2024-10-23 08:10:18 +02:00
vendor Vendor jquery.are-you-sure with strict mode fixes (#26901) 2023-09-06 00:02:44 +00:00
webcomponents Merge pull request '[PORT] Fix toAbsoluteLocaleDate and add more tests (gitea#32387)' (#5792) from gusted/forgejo-port-data-time into forgejo 2024-11-05 10:46:14 +00:00
bootstrap.js Suppress Monaco JavaScript errors in Safari (#3805) 2024-05-18 21:07:09 +00:00
bootstrap.test.js Avoid duplicate JS error messages on UI (#28873) 2024-01-21 14:23:08 +00:00
htmx.js Auto-update the system status in admin dashboard (#29163) 2024-02-17 23:24:31 +01:00
index.js [FEAT]Allow changing git notes (#4753) 2024-11-18 22:56:17 +00:00
jquery.js Forbid variables containing jQuery collections not having the $ prefix (#29839) 2024-03-20 08:46:30 +01:00
svg.js ui: update pull request icons (#4455) 2024-07-16 14:38:46 +00:00
svg.test.js Use vitest globals (#27102) 2023-09-27 04:37:13 +00:00
utils.js chore: add new lint rules 2024-10-23 08:10:18 +02:00
utils.test.js test(js): false negative in sleep test 2024-07-02 19:35:35 +02:00
vitest.setup.js [BUG] Render emojis in labels in issue info popup 2024-03-30 11:18:46 +01:00