Problem 1: currently, you can call create_component_version_media to modify the media of any ComponentVersion, even one that is published or "historic". This could be considered a form of corrupting data.
"Problem" 2: code like this code for creating a library XBlock calls create_component_and_version and create_component_version_media which "feel" like they should be grouped together using bulk_draft_changes_for, but media APIs don't participate in draft change logs.
Suggestion: what do you think about modifying create_component_version_media so that it requires that it be used within a bulk changes context, and that the ComponentVersion in question is newly-created within the same bulk draft change context?
This would be a breaking API change but would enforce two best practices: only modifying ComponentVersion as they're created, and using bulk change contexts.
Problem 1: currently, you can call
create_component_version_mediato modify the media of anyComponentVersion, even one that is published or "historic". This could be considered a form of corrupting data."Problem" 2: code like this code for creating a library XBlock calls
create_component_and_versionandcreate_component_version_mediawhich "feel" like they should be grouped together usingbulk_draft_changes_for, but media APIs don't participate in draft change logs.Suggestion: what do you think about modifying
create_component_version_mediaso that it requires that it be used within a bulk changes context, and that theComponentVersionin question is newly-created within the same bulk draft change context?This would be a breaking API change but would enforce two best practices: only modifying
ComponentVersionas they're created, and using bulk change contexts.