Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404s and a DataTables reinitialization error on /process/normalize #458

Closed
wasade opened this issue Apr 16, 2019 · 2 comments
Closed

404s and a DataTables reinitialization error on /process/normalize #458

wasade opened this issue Apr 16, 2019 · 2 comments

Comments

@wasade
Copy link
Member

wasade commented Apr 16, 2019

In the process of understanding issue #323 I observed multiple 404 errors on the plate normalization page. From an investigation of the handler logic throwing the 404, it is not obvious if the 404 is expected although after futzing with it more I believe 404s are expected here to denote that the name does not exist (First screenshot).

In an attempt to understand the HTTP query triggering the 404, which included the plate name in the URL, I attempted to add the same plate for a second time (it was also the only one in the test system). This triggered a qualitatively different response with an initialization error message from DataTables (second screenshot). I believe that message is indicative of a bug, and I'm unsure whether the state represented by the DOM is well formed and suitable to be committed to the database following the reinitialization error.

The behavior is repeatable.

Screen Shot 2019-04-16 at 4 24 45 PM

Screen Shot 2019-04-16 at 4 24 55 PM

@AmandaBirmingham
Copy link
Collaborator

So, I believe I can diagnose this. The 404s are a red herring: as @wasade concluded, 404 is the expected and acceptable response to looking up a plate name that doesn't exist (and just tells the page that plate name is in fact available for use).

Neither is the DataTables error the "real problem". The real problem is adding the same plate twice, which is a no-no--that and the fact that the interface does not PREVENT the user from performing this no-no.

Once a plate is added once, the interface SHOULD prevent it from being added a second time. This is done in most of the other places where the add plate modal dialog is used, with code like

https://github.com/jdereus/labman/blob/42c6e41f8c0a73acb2021ae11f91a19bd534830e/labcontrol/gui/templates/library_pooling.html#L346-L347

Sadly, this code was copied ALMOST but not ALL of the 7 pages that use this modal ... the normalization.html page was the only one I've found that didn't get it. Adding it to this page will keep the user from doing something they shouldn't be able to do (which then tries to make the code do something it definitely can't do: because the DataTable dom element is named quantificationsTableId = "quantificationsTablePlate" + plateId;, adding the same plate id twice leads to trying to create two DataTable objects with the same name, which the DataTable library complains about (as it should).)

@AmandaBirmingham
Copy link
Collaborator

Closed by PR #468

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants