diff --git a/CHANGELOG.md b/CHANGELOG.md index bfafcd66a..6911baf8f 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ ### v1.9.1.1 *2014-09-01* +Based on v1.9.0.6. + **ccd0** - Better fix for the bug pushing the QR's captcha response line offscreen. Previous fix caused problems with comment field resizing. @@ -14,6 +16,12 @@ Although not done using this workaround, 4chan X also requests HTTP content from - Start GIF/WebM files from the beginning when re-opened via inlining or hover view. Inlining a GIF/WebM that you are already watching via hover view does not restart it. - Fix a bug that sometimes caused the QR's captcha response line to be pushed offscreen when a captcha was loaded. +### v1.9.0.7 +*2014-09-01* + +**ccd0** +- Work around false 404s from 4chan's JSON API by checking the catalog to confirm thread death. + ### v1.9.0.6 *2014-08-31* diff --git a/src/Monitoring/ThreadUpdater.coffee b/src/Monitoring/ThreadUpdater.coffee index 8e02ce74a..17c124f18 100755 --- a/src/Monitoring/ThreadUpdater.coffee +++ b/src/Monitoring/ThreadUpdater.coffee @@ -139,17 +139,25 @@ ThreadUpdater = else ThreadUpdater.setInterval() when 404 - g.DEAD = true - ThreadUpdater.set 'status', '404', 'warning' - ThreadUpdater.kill() + # XXX workaround for 4chan sending false 404s + $.ajax "//a.4cdn.org/#{ThreadUpdater.thread.board}/catalog.json", onloadend: -> + if @status is 200 + confirmed = true + for page in @response + for thread in page.threads + if thread.no is ThreadUpdater.thread.ID + confirmed = false + break + else + confirmed = false + if confirmed + g.DEAD = true + ThreadUpdater.set 'status', '404', 'warning' + ThreadUpdater.kill() + else + ThreadUpdater.error req else - ThreadUpdater.outdateCount++ - ThreadUpdater.setInterval() - [text, klass] = if req.status is 304 - [null, null] - else - ["#{req.statusText} (#{req.status})", 'warning'] - ThreadUpdater.set 'status', text, klass + ThreadUpdater.error req if ThreadUpdater.postID ThreadUpdater.cb.checkpost() @@ -162,6 +170,15 @@ ThreadUpdater = 404: true threadID: ThreadUpdater.thread.fullID + error: (req) -> + ThreadUpdater.outdateCount++ + ThreadUpdater.setInterval() + [text, klass] = if req.status is 304 + [null, null] + else + ["#{req.statusText} (#{req.status})", 'warning'] + ThreadUpdater.set 'status', text, klass + setInterval: -> i = ThreadUpdater.interval + 1