Skip to content

A reverted media upload stays live through a later library write #2663

Open

Description

@pournasserian

Part of #2427 (F-MED). Found by the review of #2549.

A published delete of a media asset, such as reverting the set that uploaded it, only sets PublishedVersion to null. IMediaLibrary.LiveVersionAsync cannot tell "taken offline" from "never published", so it still returns the newest version a person wrote in the library. The alt text check then reads that version.

Steps:

  1. An agent uploads an image without alt text, and its set is published (version 1).
  2. A person adds alt text in the library (version 2).
  3. A person reverts the set: delete 1 → null, published.
  4. check_draft on a page that uses the image passes, though the image is offline, instead of failing with "not published".

Scope

  • Record that a published delete took an asset offline, so LiveVersionAsync returns no version until a later write or publish brings it back. Either a library write that takes effect at once or a set that publishes a version can do that.
  • Keep the case where a person's library upload is followed by an agent set's create that is then reverted: decide and test whether the person's version comes back.

Out of scope

  • Hard delete of assets and their bytes.

Acceptance

  • After a revert takes an uploaded image offline, content that uses it fails the alt text check as not published, also when a person wrote a later version in the library.
  • A person's library write after the revert counts at once again.
  • Tested on SQLite and PostgreSQL, with media in a revert set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:mediaMedia library (MED)type:bugDefectv2FluentCMS v2 (v2 branch)

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions