sequencescape icon indicating copy to clipboard operation
sequencescape copied to clipboard

DPL-523 [BUG] stock_resources table in ML warehouse not updating with QC result changes

Open neilsycamore opened this issue 2 years ago • 1 comments

QC results are not triggering stock resource rebroadcast

Outlined in this RT from James G (GSU) see below

Currently a QcResult.update_asset will automatically trigger the update of WellAttribute and attributes on Receptacle via: app/models/well/attribute_updater.rb app/models/tube/attribute_updater.rb

While well attributes appear to trigger a touch of well on save, they do not trigger a rebroadcast of any stock_resource messages, as a result, the data in the warehouse remains stale, until something else triggers a broadcast.

Performance gotchas (because I haven’t quite evicted this all from my head):

Avoid adding a trigger on well itself, it would be firing left right and centre On well attributes would probably be okay, especially if it was gated to the attributes that appear in the stock_resources table Consider eager loading of well_attributes and messengers in places like: https://github.com/sanger/sequencescape/blob/develop/app/models/qc_result_factory.rb

example plate: SQPP-2302-I

neilsycamore avatar Oct 05 '22 13:10 neilsycamore

I have tested this in prod: SQPP-2302-I:A1 (id: 65150014) I resent the stock_resource message and this updated the current vol, concentration and snp count. SQPP-2302-I:B1 (id: 65150015) I tried .touch (no change) and .save! (ditto)

neilsycamore avatar Oct 05 '22 13:10 neilsycamore