Closed zhouzi closed 7 years ago
Yes, you are spot on. This is exactly the problem and the solution.
However, you should have got code 404. Do you still remember the href that you tried?
I'm not sure but it was probably: https://api.gwentapi.com/v0/cards/BR2eUr1hQTK5sudkU-8S2Q
It seem to throw a 500 any unknown value though, e.g: https://api.gwentapi.com/v0/cards/123
Ok I found the problem, it will be fixed shortly. I forgot to check the specific error on the queries with the database to see if it was not found or if there's really an internal error.
It should now correctly throw 404 88ae2a9cc3b822c2a124d1ab18371305892e5041 . Keeping the issue open as href/uuid does change and shouldn't.
Awesome mate, your work is highly appreciated 👍
This should be improved on the next release (commit not pushed at the moment). On the next release the UUID will be regenerated using UUID5 which will allow the API to offer a stable and predictable UUID.
UUID5 is generated by giving with a namespace
uuid and a name
(some data). For the same namespace and name, the same uuid will be generated. The namespace
will be a randomly generated uuid4 that will stay constant, the name
will consist of the en-US name of the resource in question (ie: Arachas for the Arachas card). For the variation it will be the en-US name of the card that it refers to appended to the availability (the set which it comes from).
Unless the name of the resource change, the UUID should stay the same.
Should be fixed in 1102f3b
I cached the list of cards from the entry point. But then, when trying to fetch a card from its
href
I get a code 500. My understanding is that theuuid
may change when cards are crawled again but I may be wrong.If that's the case, it'd be great to conserve the same
uuid
somehow.Note that GwentAPI/arachas/issues/5 could improve the caching system and kind of fix this issue.