thechiselgroup / biomixer

BioMixer
http://bio-mixer.appspot.com/
16 stars 13 forks source link

Revise Node Cap Dialog #517

Closed everbeek closed 9 years ago

everbeek commented 9 years ago
everbeek commented 9 years ago

Thinking about whether I can move the node cap check to be before individual node fetches (as seen in a mapping expansion) rather than having it occur when they are being parsed to add them to the graph. It would save REST calls, but it would also probably lead to great code complexity; I would need a queue of possible callbacks to call, to allow failed ones to be replaced. For example, if the user chooses to allow 20 more nodes to be added, and the first 7 are private or invalid, I would want to try to fulfill those 7 slots with whatever else is available. This would require that the REST callbacks themselves be queued up, rather than checking when their callbacks occur (checking at a time when we can see if the node was valid).

The FetchOneConceptCallback and SearchOneConceptCallback appear to be the ones that don't actually cap check before REST call. ConceptParentRelationsCallback and ConceptChildrenRelationsCallback both get the list of nodes to expand, then checks the cap for the set of items it could expand. Those two actually have the node data at that point, so it's the relational data than really gets deferred by the cap check. It's probably fine to leave that, since the user will surely want at least one node expanded, and getting one costs as much as getting them all, in a way.

Checking all the FetchOne callbacks to see if they can be checked in advance like the relational properties on the Parents and Children callbacks.

This has been a bit of a hassle. I am closer to success. I didn't need to check for node errors in the cap check before, but now I believe I do. I noticed that when I added CORS, I disrupted the retrying behavior used for 500 errors...but now I only get persistent ones. I am thinking about shortening the time between retries for 500, and of course getting it working with CORS again.

everbeek commented 9 years ago

This has been a pain, but I think I am close. The cap is not working when I try to allow the full count of available nodes (even when I have expanded, come back, and received the true maximum number of nodes to expand). I always need to do number of nodes minus one in the dialog to get any nodes. Doing the max appears to fail silently.

Likely related, the mapping expansion is being checked but not triggered prior to and in addition to the term expansion. Oh, that was easy to fix. On with fixing the other problem.