Closed (fixed)
Project:
Message Notification Center
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
20 Mar 2014 at 18:51 UTC
Updated:
3 Apr 2014 at 20:01 UTC
Jump to comment: Most recent
For some reason, on some page requests, some users are having an issue where "json" object in Drupal.mnc.requestUnreadCounter is sometimes null.
See these screenshots:
http://i.imgur.com/mm5H7ZE.png
http://i.imgur.com/0qGYbBh.png
Could put an if(json) check to avoid errors, but any ideas on why this might be happening? I'm running Apache behind Varnish and CloudFlare, and not sure if those "layers" might be contributing...
Relevant code chunk:
var data = $.ajax({
type: 'POST',
url: Drupal.settings.basePath + 'mnc/ajax-unread-count',
dataType: 'json',
async: false
});
var json = jQuery.parseJSON(data.responseText);
Comments
Comment #1
jordanmagnuson commentedComment #2
Andre-Bgracefully handled bad responses. which might have been caused due to logged out users with multiple tabs and/ or old sessions. returning 0 in that case and logging to the console if present.