From 42887d41c464846877265298600731dbc8538ad7 Mon Sep 17 00:00:00 2001 From: howard-stearns Date: Wed, 3 May 2017 13:45:48 -0700 Subject: [PATCH] debugging --- scripts/system/tablet-goto.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/system/tablet-goto.js b/scripts/system/tablet-goto.js index b9ca6f7407..6c18d0a681 100644 --- a/scripts/system/tablet-goto.js +++ b/scripts/system/tablet-goto.js @@ -145,15 +145,22 @@ var stories = {}, pingPong = false; var DEBUG = true; //fixme + function debug() { + if (!DEBUG) { + return; + } + print([].map.call(arguments, JSON.stringify)); + } + function expire(id) { request({ uri: location.metaverseServerUrl + '/api/v1/user_stories/' + id, method: 'PUT', body: {expired: true} }, function (error, response) { + debug('expired story', id, 'error:', error, 'response:', response); if (error || (response.status !== 'success')) { print("ERROR expiring story: ", error || response.status); - return; } }); } @@ -170,9 +177,11 @@ 'per_page=' + count ]; var url = location.metaverseServerUrl + '/api/v1/user_stories?' + options.join('&'); + url = 'https://highfidelity.com/api/v1/user_stories?include_actions=announcement'; //fixme remove request({ uri: url }, function (error, data) { + debug(url, error, data); if (error || (data.status !== 'success')) { print("Error: unable to get", url, error || data.status); return; @@ -181,6 +190,7 @@ pingPong = !pingPong; data.user_stories.forEach(function (story) { var stored = stories[story.id], storedOrNew = stored || story; + debug('story exists:', !!stored, storedOrNew); if ((storedOrNew.username === Account.username) && (storyOrNew.place_name !== location.placename)) { expire(story.id); return; // before marking