seek icon indicating copy to clipboard operation
seek copied to clipboard

Error with LinkingSamplesUpdateJob

Open stuzart opened this issue 1 year ago • 1 comments

error occuring:

A TypeError occurred in background at 2024-05-22 00:12:14 UTC :

  no implicit conversion of String into Integer
  /srv/rails/fairdomhub/app/models/sample.rb:145:in `[]'

-------------------------------
Backtrace:
-------------------------------

  /srv/rails/fairdomhub/app/models/sample.rb:145:in `[]'
  /srv/rails/fairdomhub/app/models/sample.rb:145:in `block (3 levels) in refresh_linking_samples'
  /srv/rails/fairdomhub/app/models/sample.rb:144:in `each'
  /srv/rails/fairdomhub/app/models/sample.rb:144:in `block (2 levels) in refresh_linking_samples'
  /srv/rails/fairdomhub/app/models/sample.rb:142:in `each'
  /srv/rails/fairdomhub/app/models/sample.rb:142:in `block in refresh_linking_samples'
  /srv/rails/fairdomhub/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.7/lib/active_record/relation/delegation.rb:88:in `each'
  /srv/rails/fairdomhub/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.7/lib/active_record/relation/delegation.rb:88:in `each'
  /srv/rails/fairdomhub/app/models/sample.rb:138:in `refresh_linking_samples'

offending line https://github.com/seek4science/seek/blob/main/app/models/sample.rb#L145

I think with if sample['id'] == id , one is a String and the other and Integer, so needs converting

stuzart avatar May 22 '24 13:05 stuzart

seems to be encountering an array instead of hash, and maybe related to multiple linked samples - but I've not yet been able to reproduce. Might be caused by being registered through the API

stuzart avatar Jun 14 '24 14:06 stuzart