diff --git a/app/services/cocina_object_store.rb b/app/services/cocina_object_store.rb index 335dd91c8..12e13e224 100644 --- a/app/services/cocina_object_store.rb +++ b/app/services/cocina_object_store.rb @@ -97,7 +97,7 @@ def find(druid) return cocina unless Settings.enabled_features.repository_object_test legacy = ar_find(druid).to_cocina_with_metadata - return cocina if legacy == cocina + return cocina if Cocina::Models.without_metadata(legacy) == Cocina::Models.without_metadata(cocina) Honeybadger.notify('Comparison of RepositoryObject with legacy object failed.', context: { druid: }) return legacy diff --git a/spec/services/cocina_object_store_spec.rb b/spec/services/cocina_object_store_spec.rb index 0fe51659f..2158ded55 100644 --- a/spec/services/cocina_object_store_spec.rb +++ b/spec/services/cocina_object_store_spec.rb @@ -86,6 +86,10 @@ context 'when objects match' do let(:version_attributes) { RepositoryObjectVersion.to_model_hash(ar_cocina_object.to_cocina) } + before do + repo_object.head_version.update!(updated_at: 1.day.ago) + end + it "doesn't report a diff" do expect(store.find(repo_object.external_identifier)).to be_instance_of(Cocina::Models::DROWithMetadata) expect(Honeybadger).not_to have_received(:notify)