Skip to content

Keep the media form's base version and stop refused uploads filtering the library - #2651

Merged
pournasserian merged 5 commits into
v2from
2629-media-form-fixes
Oct 19, 2026
Merged

pournasserian merged 5 commits into
v2from
2629-media-form-fixes

Conversation

@pournasserian

@pournasserian pournasserian commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Closes #2629

What

Follow-ups from the independent review of #2601 (F-MED, #2427).

  • Base version. The asset page's hidden BaseVersion comes from the form being shown. A form refused for its own problems keeps the version it started from, so its next save is refused as a conflict instead of overwriting a change saved meanwhile.
  • Refused uploads no longer filter the library.
    • The return query uses upload-error, upload-folder, upload-tags, upload-alt and upload-caption, which no list filter reads.
    • A field whose escaped text is over 1500 characters isn't carried back. upload-dropped names it, and the form says to type it again, so the redirect stays well inside the server's request line limit.
    • Empty fields are left out of the return query.
  • sub and uploaded are read as text. sub takes 1 or true. A value that isn't a flag counts as false instead of failing the page with a 500. uploaded has the same bug as sub, so it is fixed here too.
  • Where-used rows link to the item's audit history. An entity type's items link as entity and other items as entry, as the log names them.
  • An upload that declares a body over the limit gets the library's "too large" message instead of a reset connection.
    • UseMediaUploadLimit runs before the anti-forgery check. It reads and discards the declared body, then redirects back to the library.
    • It applies to a signed-in person, with a body up to 1 GB.
    • A chunked body that declares no length still meets the server's limit.

Why

  • Discard the body, then answer. A browser still sending its upload treats an early answer as a failed request. Kestrel aborts a drain over the endpoint's limit, so the limit is lifted for that request only.
  • Upload names of its own. The upload form and the list share the page, so names the list doesn't read can never filter it.

Tests

  • The media screen tests run on SQLite and PostgreSQL.
  • An anonymous upload goes to sign-in.
  • The Keep the media details form's base version and stop refused uploads filtering the library #2629 overwrite scenario ends in the conflict message, and the other person's change stays.
  • After a refused upload, the library lists every asset.
  • A refused SVG upload says its type can't be uploaded.
  • A PDF downloads as an attachment, with its file name.
  • sub=1 lists subfolders, and sub=yes doesn't.
  • uploaded=abc shows the page without the upload note.
  • An upload declared over the limit comes back with the too-large message and stores nothing.
  • Where-used rows link to an entry's history, and to an entity's history as entity, in bUnit.
  • bUnit:
    • The upload's fields never filter the list.
    • A dropped field is named.
    • The sub flag takes 1 and true.
    • The return query drops a text too long to carry.

SignedInPageTests gives each page load a 30-second deadline that names the page. That test hung once on PostgreSQL in CI on v2, and passed on re-run, so the next failure says which page it was.

dotnet build -warnaserror, the unit and bUnit suite and the media tests on SQLite and PostgreSQL pass locally. No new package and no new project reference.

Checklist

  • Linked to an issue a maintainer has confirmed
  • Targets v2
  • Tests or docs updated where behaviour changed
  • No tool-generated co-author trailers or footers

@pournasserian pournasserian added this to the M1 Governance core milestone Oct 19, 2026
@pournasserian pournasserian added v2 FluentCMS v2 (v2 branch) type:bug Defect area:media Media library (MED) labels Oct 19, 2026
… on both providers, and name a page that hangs
@pournasserian
pournasserian merged commit aee53bb into v2 Oct 19, 2026
2 checks passed
@pournasserian
pournasserian deleted the 2629-media-form-fixes branch October 19, 2026 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:media Media library (MED) type:bug Defect v2 FluentCMS v2 (v2 branch)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keep the media details form's base version and stop refused uploads filtering the library

1 participant