-
Notifications
You must be signed in to change notification settings - Fork 26
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
Should we always mint a new ID when creating a tree or study? #1302
Comments
OK, so we do this properly for new studies. Each is issued a unique, newly-minted ID, and a persistent counter is incremented. So all good there. I'll check tree IDs next. |
OK, so new tree IDs are minted in client-side Javascript. During a single study-edit session, we liberally mint new IDs for each attempted submission, so there's no chance of a duplicate. BUT we don't save this It's kind of an edge case, but if the consequences are dire enough (wrong tree in synthesis!) we could manage this by saving the last-attempted tree ID in the study Nexson, or by minting stronger unique IDs along the lines of |
This should avoid possible confusion, e.g. when adding trees to a collection. We want to avoid using `tree4` in a collection, then deleting it and re-using the old ID. Addresses #1302.
@snacktavish The feature branch above (currently working on devtree) mints new tree IDs by a completely different method. Instead of simple incrementing IDs (
The only safe alternative I can think of would be for each study to keep track of all IDs it has used or attempted to use previously. I suppose keeping a old-school counter would work, but still fails in the event of a tree that's created, added to a collection, then the curation session is abandoned without saving. So we're back to needing to force a save of the study before adding any of its trees to a collection. Seems weird, but maybe the lesser of evils if we don't like this. |
@snacktavish Oh, one minor usability query: Would these six-digit tree IDs like |
I'll take a look, but I def think single digits are highly preferable, because there are several places where a human needs to read and track them. Maybe even worth the readability at the risk of tree number re-use. |
This might avoid confusion in our tree-collection feature, if it can mis-match a new study/tree because serial IDs are being re-used. (E.g., If I remove tree2 from a study, then create a new tree, does it re-use the ID?)
IF this is happening, we should save the last-used IDs for each and ALWAYS increment.
The text was updated successfully, but these errors were encountered: