unitaryfund/metriq-api

Can't cancel when attempting to edit and not logged in

Closed this issue · 3 comments

This only happened the first time I tried, but I tried to edit this benchmark http://18.190.41.255/Submission/611800b58d4c8079d6b4f77f by clicking the edit button right under the name, and it did this:

image

I only had the cancel button, but when I clicked it, it wouldn't back out and instead gave me effectively the same message again.

I'm investigating. I'll see if I can reproduce this.

I'm clicking like mad, but I'm not sure what triggered this. However, I notice a potential structural problem that might increase the likelihood of this happening: both "Cancel" and "Submit" are handled by the same method, which blocks "Submit" if the user "state" is not logged in.

Whether I can ever reproduce this, it's far less likely to ever occur we switch out the handler methods per mode, instead of using the same handler method for both cases. I'll fix this, now.

I think the best I can do for that moment is the PR I just opened, @crazy4pi314. Feel free to take a look, but it's not likely to be obvious why that probably removes the systemic design problem, though I can't reproduce the bug, yet.