msupply-foundation / open-msupply

Open mSupply represents our most recent advancement in the Logistics Management Information System (LMIS), expanding on more than two decades of development inherited from the well-established legacy of the original mSupply.
https://msupply.foundation/open-msupply/
Other
23 stars 15 forks source link

When two items are added to a vaccine course, and then merged, two duplicate items show in vaccine course view #4168

Open fergie-nz opened 4 months ago

fergie-nz commented 4 months ago

What went wrong? 😲

If two items are added to the same vaccine course, and subsequently merged, they will show up as a duplicate in the vaccine course view.

Possibly an issue which is problematic elsewhere in the code base? I wonder how merged items are handled where both are referenced in an itemLoader (such that is_active filters aren't used)?

Image 18-06-2024 at 13 14

referenced here: https://github.com/msupply-foundation/open-msupply/pull/4163#issuecomment-2174721580

Expected behaviour 🤔

How to Reproduce 🔨

Steps to reproduce the behaviour:

  1. Go to Vaccine Course view (in Immunisation Program view)
  2. Add two items to a vaccine course
  3. Merge these items in mSupply
  4. sync
  5. See duplicate items in the vaccine course view

Your environment 🌱

andreievg commented 4 months ago

Triage, needs refinement as there will be other use cases where configurations are done on COMS and some processing might need to be done (i.e. for pack variants), so far hasn't been an issue because COGS does the merge and does central config so is able to solve duplicates in master lists

Quick check, what happens when two items are merged in master list and for requisitions ?

andreievg commented 4 months ago

Refinement, the actual process to dedup centrally configured data can be done when we do omSupply merge, mainly for things like master list and maybe pack variants, this case looks like it should be ok as is for now. Setting severity is low.

andreievg commented 4 months ago

Had a check, in OG, when two items are merged, and they were both in a master list and internal order. Master list shows just one item, and internal order still has the two