inventaire / inventaire-client

webapp coupled to the inventaire server :books:
https://inventaire.io
47 stars 16 forks source link

invalid entity type when trying to add a new author to a work #494

Open raphodn opened 1 month ago

raphodn commented 1 month ago

Hi ! New user here, sorry in advance if I'm doing something wrong or if my issue is basic..

I created my account, uploaded my list of books, and I am going through the few books where the author is "unknown".

For this work - https://inventaire.io/entity/inv:8f87757e49ac143cecbc7522dafa41af/edit - I had to create the author in wikidata : https://www.wikidata.org/wiki/Q125998095 (my first contribution there in a long time)

But I am not able to add it afterwards as the author of the work, I get a "invalid entity type" error.

Thanks in advance for your help :)

maxlath commented 1 month ago

Hi! That was a caching issue: Q125998095 had been put in the inventaire server cache before it had a P31=Q5 statement, making it an entity without type. Forcing a cache refresh (by visiting the entity editor page https://inventaire.io/entity/wd:Q125998095/edit or via the API https://inventaire.io/api/entities?action=by-uris&uris=wd:Q125998095&refresh=true) fixed the issue.

One way to reduce false positives on that error could be to automatically force a cache refresh when encountering this error.