-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Hedge for when consul sends nodes with an empty ID #4331
Conversation
I don't think this would have a large effect on the UI whichever but best to make sure
@@ -1,6 +1,14 @@ | |||
import Adapter from './application'; | |||
import { PRIMARY_KEY, SLUG_KEY } from 'consul-ui/models/node'; | |||
import { OK as HTTP_OK } from 'consul-ui/utils/http/status'; | |||
// TODO: Looks like ID just isn't used at all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean that ID isn't used at all here? It looks like you're generating IDs on the client and using that as the primary key (uid
) so ember data is never using the ID from the server for its identity map. Probably not an issue as long as you're not caching the list or editing things, but something to be aware of if you ever want to add that sort of thing. I'm guessing you already work around that though for individual node pages (or you fetch the group first).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, yeah its more or less a note to go back and consider just ignoring ID
completely, and just pretend Node
is the 'unique key' to use for the slug. It sounds like that is always unique and ID
can sometimes be empty, although, even while I'm writing this, the more i think about it the more I'd just continue to use ID
- it just reads better plus the big has been fixed in the backend now - this is just for old data I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is more just in case right? The linked PR should now be generating a UUID on the backend, yeah?
Either way, code looks good! Had one comment that was more observation than anything. 👍
Yup, mkeeler fixed a bug in the backend where you'd end up with nodes with no Cheers! |
Addresses #4305 and #4249 also see #4294
This uses the node
Name
as the unique 'slug' ifID
is blank