maxlath / wikibase-cli

read and edit a Wikibase instance from the command line
MIT License
227 stars 24 forks source link

Fails on entities with too recent properties #28

Closed ghost closed 7 years ago

ghost commented 7 years ago

wikidata-cli fails when reading/writing entities containing very recent properties. i.e:

$ wd claims Q41610011
TypeError: Cannot read property 'type' of undefined
    at BuildClaimsText (/usr/lib/node_modules/wikidata-cli/lib/log_claims.js:43:39)
    at Promise.all.then.results (/usr/lib/node_modules/wikidata-cli/lib/log_claims.js:22:28)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

It fails because of the P4276, created yesterday.

The property is not in the known props list:

$ wd p
[…]
  "P4241": null,
  "P4242": "vitesse ascensionnelle (maximale)",
  "P4243": null
}

I'm not sure it's an outdated server cache, or a runtime local info that is has to be updated. Is there a workaround?

maxlath commented 7 years ago

it happens when the local properties list is outdated, it can be fixed by running ẁd props --reset, I replaced the error message you got by that advice: 03f1205

ghost commented 7 years ago
$ wd claims Q41610011
the property P4276 could not be found
run `wd props --reset` to refresh the local properties list

Way much clearer!

Thank you for the hint and the patch, Maxime.