-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature/only keep good data #22
Conversation
@circlecube While this is great, it wouldn't have prevented the issue we saw the other day. The issue was with the This was the payload we were seeing:
|
Oh, I think these were both separate requests combined into one, right? So your check would apply to the products portion of the request not having a |
Correct, I added one for products but I'm also adding one for categories endpoint too. So they both have the same check. The data is one field from the proper response. Looks like the error state only returned a message key. A proper response should include the data, meta and links keys but I figured just checking for data was enough and that expecting the data array to have a length of at least one might be a good addition, but felt a little overkill. |
@circlecube It would be cool if we could define a JSON schema file for the expected responses from the Hiive and then could use those for testing on the Hiive as well as for validation of response data structures on the plugin side. Not sure how feasible that would actually be, but could guarantee that cached responses are always valid. |
I like this idea. Maybe we create a task to help us get there. I don't want to expand this fix too much before getting it out. |
Before storing data, also check that products and categories response contains key of data, since that's where the content should be and a hiive error returns only a
message
key.Also, when the conditions are not met, the method will now return
false
so following processes will exit.