-
Notifications
You must be signed in to change notification settings - Fork 188
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
feat(compass-global-writes): invalid and mismatching shard key state COMPASS-8278 #6371
Conversation
c9ab6c4
to
341c341
Compare
if (!shardKey) { | ||
throw new Error('Shard key not found in ShardKeyMismatch'); | ||
} |
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.
Super splitting hairs here, caught my eye and I started thinking whether or not it would be better to throw in render or in connect
function for this: this code absolutely makes sense, at the same time it's a property of the store that this state might be undefined and depends on the state status, as we are not actually passing the status to the component (totally makes sense!), maybe the status check and a throw
should be kept to the connect function, then we can make this property required on the component? Idk, just really some thoughts about minute details of how we should be doing mapping of state in similar cases, what do you 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.
That makes sense actually. Even though theoretically in this particular setup the error could be due to wrong routing in the index component, it makes sense that the component would just expect matching & valid state. It is the connector's responsibility to map the state, so it should be the one to notice that the state is wrong. Thanks for pointing it out!
Description
Adding two new screens, handling the invalid and mismatching shard key states. This one was pretty straight-forward. Content taken from current data-explorer, updated to Compass/LG components.
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes