Closed missyschoenbaum closed 5 years ago
@missyschoenbaum can you look at the database to look for obvious break points when a new population is imported.
This seems like it is a bigger issue when a new population comes in and we are still keeping bad linked data.
Probably causing #896
Sorry - here you go . Priority Order is the main hang up. Missy look at database to see if obvious break point. Thought on this, should we present a message before replace proceeds to clarify what will happen? This helps cover our bases. Obvious break points are: *_trigger_group Spreadbetweengroups_relevant_groups Vaccinationringrule_target_group Vaccinationringrule_trigger_group I thought about destruction_global. The priority only calls generically production type. The actual order is set at the bottom of the destruction control protocol, which is then later assigned to a new production type in the case of a replace population. On this one, we should be OK, even though it didn’t appear that way to me at first. This is one of the things that changes when I was testing.
After discussions, preferred solution to prompt user to validate is to: remove all vaccination global settings remove all rings remove all triggers There's minimal reentry of data in this, or the parameter is basically created from the production type that will no longer exist.
Message on delete will provide details to allow user to consider before taking this step. That's in another issue.
Testing should be done to ensure multiple Vaccination Triggers are being deleted properly. A known bug exists where the Vaccination Global instance is being destroyed but the page is not updating - leaving invalid production types rendered in the Vaccination Priorities widget until the page is updated by the user. Working on correcting this bug before moving on to next ticket.
I have an email out to Bryan about some interesting things I noticed while working on this ticket - but they don't relate directly to the functionality of this ticket.
Moving to testing.
I like the additional warnings approach in the javascript for this. This looks good, so I'll get it into the next compile.
Here's what it did for me.
I set up new scenario, confirmed I had plenty of triggers and ring to start vaccination. I ran 10 iterations just to confirm I had a working scenario. Also confirmed I had my replacement population ready to go, since it had been a while since I looked at it.
Did file Save Ad from working scenario to make a testing scenario. Went to Population Hit replace Message appears - text is appropriate. The exit X is slightly wonky, but minor issue. I hit the Delete button. Nothing happens. I waited, as it could take a while. I am using Sample Scenario to start, so it should be small delete. I hit delete again and counted, just to be sure I was not impatient or distracted. No action or hint of action after 20 seconds. Cancel works nicely, so I am returning to you guys.
Wait, let me also post dialog from cmd. It will take a minute. It said something, but I had already hit close.
Aha! The delete portion must have worked, because my scenario comes back with lots of missing connections, and Population is sitting where I can pick a new file. The right action happen, the flow just got off track somewhere. Let me try again from the beginning and see if I can sort out where I fell off the planet.
Here's what I think happens. The delete works, but it doesn't return focus to the Population page where I can pick a new file. It just leaves me in the Delete window. Here's an image of the front and the back together where it stops.
The replace population's first step is to delete the population and population-dependent models, this can take quite a long time as there are a number of models that have to be collected before they can be deleted. When you hit that delete button it starts this process, but gives the user no indication that it is doing anything in the background (even worse if users are unaware they can look at the command window to see output). If the user cancels or redirects during this process - ADSM is not sure exactly how to handle the missing data, and it appears in your case it just prevented you from completing the deletion (I can give a more technical explanation of why this happens if you are curious). I changed the code so when you hit that delete button it immediately redirects you to the loading screen while it does the deletion in the background before finally redirecting you to the new population screen. This should prevent users from thinking that either nothing is happening or from pressing other buttons and making the deletion impossible.
The sample scenario for me takes about 20 seconds to delete the population, on laptops or slower computers this will take longer. This can feel like a long time when you are just sitting there staring at a loading screen (or a screen that does not appear to be doing anything!). Be patient!
Looks like there is an error in the confirmation text, I'm going to just perform the fix and get this ticket back to testing.
Tested through on small and large example. Rings and triggers worked. Calling this good.
When we replace the population, all the production type assignments are deleted, as we would expect.
On the Vaccination triggers, rings and priorities, we have a different situation. The trigger (or ring) still exists, but it doesn't have a production type attached to it. It is smart that it doesn't, that is the right action. However, the user doesn't get a visual cue that this has happened.
On the Trigger and Ring, can we just delete any existing triggers/rings? Would the visual cue turn yellow?
Vaccination Priorities is harder, because we have to present the list of production types. That part can't disappear. Is there something we could do to make it turn the visual cue yellow until the user went to the page and hit apply?
I'm open to other suggestions if you guys can think of anything.