ameliabradley / wikiedit-monitor

Wikipedia monitor
3 stars 2 forks source link

TypeError: Cannot read property 'revold' of undefined #35

Open Barbarrosa opened 8 years ago

Barbarrosa commented 8 years ago
------------------------------------------------------------------------------------------
| Saving 7 edits.                                                                        |
|----------------------------------------------------------------------------------------|
| Rejected [not_cached]                                                                  |
|----------------------------------------------------------------------------------------|
| JGG13                | Wikipedia:Requested articles/A | /* Schools, colleges, and univ |
| Faizhaider           | User talk:Scf india            | Notifying author of deletion n |
------------------------------------------------------------------------------------------
***** INSERTED (socketdata:23,socketdata_last_hour:23,wikiedits:7,errorlog:1) records in 14ms
***** Requesting 8 diffs from Wikipedia
***** Wikipedia returned in 0.33s
/home/tbradley/Projects/wikiedit-monitor/src/EditLog/EditLog.js:97
                  revold: parseInt(oRev.revold),
                                       ^

TypeError: Cannot read property 'revold' of undefined
    at /home/tbradley/Projects/wikiedit-monitor/src/EditLog/EditLog.js:97:40
    at IncomingMessage.<anonymous> (/home/tbradley/Projects/wikiedit-monitor/src/EditLog/WikiApi.js:76:11)
    at emitNone (events.js:72:20)
    at IncomingMessage.emit (events.js:166:7)
    at endReadableNT (_stream_readable.js:921:12)
    at nextTickCallbackWith2Args (node.js:442:9)
    at process._tickCallback (node.js:356:17)
Barbarrosa commented 8 years ago

I had this exact same error again today.

Barbarrosa commented 8 years ago

This happens because the revision is queried just before the article is deleted. We need to be prepared for a successful response from Wikipedia for deleted revisions.

Since the revision was locally purged but came back with data, the lookup fails even though the API returned data.