Open MaxGhenis opened 3 months ago
Unfortunately, I don't think preserving the policy ID would be the fix here, unless we more fully embraced the logged-in user experience. At present, the API guarantees that every significant change to a policy will create a new one; this includes renaming the policy, adding a provision, etc. If we were to keep the policy ID, then anytime any user created the same policy, they would have this renamed policy as their own. This would also mean multiple users could be renaming the same policy.
A more effective fix in the short run may be to somehow abort calculation when renaming at certain points.
Huh I think it used to preserve the policy ID before the sign in model. @nikhilwoodruff is that right?
Let's please do this. I find myself frequently renaming the policy after running computations, then sending it where viewers have to wait for it to run.
@MaxGhenis got the concern- but talking through with Anthony there's some significant complexity (/confusion in the UI) if we did this (e.g. people renaming others' policies, making them unsearchable, etc.) We could eventually solve with permissions-based UX I guess, but seems lower priority and high-effort considering other priorities. In the meantime, could you name policies before running them? :)
How about letting anyone name a policy that hasn't yet been named?
That wouldn't solve your immediate issue, though, would it?
I think the way to solve this would be to equate the policy_id
key of the data with an individual simulation run from an individual user with an individual label, while treating the policy_hash
as one set of reforms. Any time we do something that is meant to affect all reforms of the same type (e.g., caching simulation runs), we operate based upon policy_hash
, while any time we do anything that would be attributable to an individual user, we use policy_id
. This would also be far more standard than our handling.
The problem underpinning all of this is is that the API only creates new records for new country-label-policy sets, but not for each new instance of a user modifying a parameter set. The impact of this is described in the user flow below:
I think the long-term way to proceed with this issue (and some related) is to move to using policy IDs as individual record identifiers, as described at the top, then ensuring that the app is updated to match those assumptions. Shorter-term, renaming before running computations would avoid the issue.
Currently naming a policy gives it a new policy ID, meaning users have to wait for another microsimulation when navigating off the page