forgejo/models
Mathieu Fenniak 1f2bbbd4aa fix: prevent user-entered text with | characters from being truncated in activity feed (#8844)
Prevents a variety of user-entered texts that can contain `|` characters from being truncated in the activity feed, affecting: issue & PR titles, comment content, review comments, and review dismissal comments.

Where `action.content` was containing a pipe-separated list of UI data fields before, it now uses a JSON-encoded string array.  The old format is still supported for reading from the feed.  In some places where `action.content` was not using this format, or where user-generated text was not inserted, the old format is retained.

Fixes part of the cause behind #8781, allowing small mermaid graphs to be rendered in the feed (for now...) --
![image](/attachments/4de98825-4fb7-4b5d-87c3-bd54d6f0a1d1)

## 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...
  - [x] in their respective `*_test.go` for unit tests.
  - [x] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [ ] 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/8844
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-08-10 19:48:46 +02:00
..
actions fix(test): TestActionsArtifactOverwrite needs ordered query for pgsql (#8847) 2025-08-10 13:54:27 +02:00
activities fix: prevent user-entered text with | characters from being truncated in activity feed (#8844) 2025-08-10 19:48:46 +02:00
admin chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
asymkey chore: do not require empty fixtures to clean tables (#8353) 2025-06-30 23:04:16 +02:00
auth feat: consider WebAuthn & SSH for instance signing (#7693) 2025-04-29 10:34:07 +00:00
avatars chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
db feat: improve mysqlGetNextResourceIndex to use modern MariaDB features (#8691) 2025-08-08 01:51:55 +02:00
dbfs Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
fixtures fix: make the action feed resilient to database inconsistencies (#8617) 2025-07-22 23:40:30 +02:00
forgefed Federated user activity following: Isolated model changes (#8078) 2025-06-21 12:02:58 +02:00
forgejo/semver Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
forgejo_migrations feat: add tag label to commit list view (#8759) 2025-08-06 14:47:51 +02:00
git feat: always publish the link to the commit status (#8177) 2025-06-13 12:41:34 +02:00
issues feat(ui): add links to review request targets in issue comments (#8239) 2025-07-23 04:45:58 +02:00
migrations feat: migrate action secrets to keying to store them more securely (#8692) 2025-07-29 01:03:36 +02:00
moderation feat: add configurable timeout for automatically removing resolved reports (#7940) 2025-07-28 14:52:13 +02:00
organization fix(ui): wrong org dashboard links when switching dashboard context (#8688) 2025-08-07 14:32:55 +02:00
packages several fixes of ALT Package registry (#8475) 2025-07-10 17:12:07 +02:00
perm Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
project chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
pull fix: do not ignore automerge while a PR is checking for conflicts (#8189) 2025-06-17 10:58:07 +02:00
quota fix: ignore expired artifacts for quota calculation (#7976) 2025-05-28 18:22:10 +02:00
repo feat: add tag label to commit list view (#8759) 2025-08-06 14:47:51 +02:00
secret feat: migrate action secrets to keying to store them more securely (#8692) 2025-07-29 01:03:36 +02:00
shared/types chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
system Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
unit feat: configurable default units for mirrors (#7902) 2025-06-03 08:12:29 +02:00
unittest chore: do not require empty fixtures to clean tables (#8353) 2025-06-30 23:04:16 +02:00
user feat: add option to allow non-local users to change usernames (#8714) 2025-08-06 20:25:13 +02:00
webhook Actions Failure, Succes, Recover Webhooks (#7508) 2025-06-03 14:29:19 +02:00
error.go API: enforce sha requirement on POST /repos/{owner}/{repo}/contents (#8139) 2025-06-12 00:13:39 +02:00
main_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
org.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
org_team.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
org_team_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
org_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
repo.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
repo_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
repo_transfer.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
repo_transfer_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00