jojo/services
Gusted 91e3c36c69 [v11.0/forgejo] fix: don't trip deleting attachment with missing permission error (#11679)
**Backport of forgejo/forgejo#11642**

- Deleting attachments are also seen as updating attachments due to the frontend always sending a field to edit the name even if the name didn't change. This was not reflected in the unit tests.
- Refactor the updating attachment logic to be more flexible if a attachment does not exist, because it was just deleted or because someone is being malicious.
- Resolves forgejo/forgejo#11636

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/11642
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
(cherry picked from commit 8572835160)

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Bug fixes
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/11679): <!--number 11679 --><!--line 0 --><!--description Zml4OiBkb24ndCB0cmlwIGRlbGV0aW5nIGF0dGFjaG1lbnQgd2l0aCBtaXNzaW5nIHBlcm1pc3Npb24gZXJyb3I=-->fix: don't trip deleting attachment with missing permission error<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/11679
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
2026-03-14 19:11:33 +01:00
..
actions [v11.0/forgejo] fix: don't duplicate commit status records on workflows with empty name (#10681) 2026-01-05 15:03:46 +01:00
agit [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
asymkey [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
attachment fix: check that attachments belong to correct resource 2026-03-06 11:20:50 -07:00
auth fix: consider scopes for OAuth2 token via basic login 2026-03-06 11:20:50 -07:00
automerge chore: add integration testing 2026-03-06 11:20:50 -07:00
context fix: reduce memory usage while processing large attachment uploads 2026-01-06 11:07:10 -07:00
contexttest [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
convert fix: hide user profile anonymous options on public repo APIs 2026-01-06 10:44:07 -07:00
cron [v11.0/forgejo] fix: LFS GC is never running because of a bug in the parsing of the INI file (#9222) 2025-09-09 23:39:20 +02:00
doctor [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
externalaccount [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
f3 [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
federation [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
feed fix: load reviewer for pull review dismiss action notifier 2026-01-06 11:10:12 -07:00
forgejo [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
forms [v11.0/forgejo] fix: don't allow credentials in migrate/push mirror URL (#9065) 2025-08-30 18:53:14 +02:00
gitdiff [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
indexer [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
issue [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
lfs [v11.0/forgejo] fix: return on error if an LFS token cannot be parsed 2025-10-25 13:19:39 -06:00
mailer chore: add unit test 2026-03-08 20:07:42 -06:00
markup [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
migrations [v11.0/forgejo] fix(migrations): transfer PR flow information (#7437) 2025-04-03 07:35:20 +00:00
mirror [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
notify [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
org [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
packages [v11.0/forgejo] fix: package cleaned rule fails if the keep count is too high (#9469) 2025-09-29 18:02:21 +02:00
pull [v11.0/forgejo] fix: correctly compute required commit status (#10787) 2026-01-12 13:08:25 +01:00
redirect [v11.0/forgejo] fix: only redirect to a new owner (organization or user) if the user has permissions to view the new owner (#9089) 2025-08-30 18:52:43 +02:00
release [v11.0/forgejo] fix: don't trip deleting attachment with missing permission error (#11679) 2026-03-14 19:11:33 +01:00
remote [v11.0/forgejo] chore: tune down remote user promotion debug message shown as error (#7691) 2025-04-29 13:31:36 +00:00
repository [v11.0/forgejo] fix: prevent .forgejo/template from being out-of-repo content 2025-10-24 22:08:23 -06:00
secrets [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
shared/automerge [v11.0/forgejo] fix: do not ignore automerge while a PR is checking for conflicts (#8456) 2025-07-09 14:09:12 +02:00
task [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
uinotification [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
user [v11.0/forgejo] fix: delete old auth token upon replacing primary email (#9086) 2025-08-30 18:56:28 +02:00
webhook [v11.0/forgejo] chore: merge tests.AddFixtures and unittest.OverrideFixtures (#7649) 2025-04-25 09:59:30 +00:00
wiki [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00