<div class="releasenotes">
</notextile>
-h2(#main). development main (as of 2020-10-28)
+h2(#main). development main (as of 2020-12-10)
"Upgrading from 2.1.0":#v2_1_0
+h3. Changes on the collection's @preserve_version@ attribute semantics
+
+The @preserve_version@ attribute on collections was originally designed to allow clients to persist a preexisting collection version. This forced clients to make 2 requests if the intention is to "make this set of changes in a new version that will be kept", so we have changed the semantics to do just that: When passing @preserve_version=true@ along with other collection updates, the current version is persisted and also the newly created one will be persisted on the next update.
+
h3. Centos7 Python 3 dependency upgraded to python3
Now that Python 3 is part of the base repository in CentOS 7, the Python 3 dependency for Centos7 Arvados packages was changed from SCL rh-python36 to python3.
|is_trashed|boolean|True if @trash_at@ is in the past, false if not.||
|current_version_uuid|string|UUID of the collection's current version. On new collections, it'll be equal to the @uuid@ attribute.||
|version|number|Version number, starting at 1 on new collections. This attribute is read-only.||
-|preserve_version|boolean|When set to true on a current version, it will be saved on the next versionable update.||
+|preserve_version|boolean|When set to true on a current version, it will be persisted. When passing @true@ as part of a bigger update call, both current and newly created versions are persisted.||
|file_count|number|The total number of files in the collection. This attribute is read-only.||
|file_size_total|number|The sum of the file sizes in the collection. This attribute is read-only.||
validate :protected_managed_properties_updates, on: :update
after_validation :set_file_count_and_total_size
before_save :set_file_names
+ before_update :preserve_version_exclusive_updates_leave_modified_at_alone,
+ if: Proc.new { |col| col.changes.keys.sort == ['modified_at', 'updated_at', 'preserve_version'].sort }
around_update :manage_versioning, unless: :is_past_version?
api_accessible :user, extend: :common do |t|
if should_preserve_version
self.version += 1
- self.preserve_version = false
+ if !changes.keys.include?('preserve_version')
+ self.preserve_version = false
+ end
end
yield
end
end
+ def preserve_version_exclusive_updates_leave_modified_at_alone
+ self.modified_at = self.modified_at_was
+ end
+
def syncable_updates
updates = {}
if self.changes.any?
idle_threshold = Rails.configuration.Collections.PreserveVersionIfIdle
if !self.preserve_version_was &&
+ !self.preserve_version &&
(idle_threshold < 0 ||
(idle_threshold > 0 && self.modified_at_was > db_current_time-idle_threshold.seconds))
return false