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

jordanmagnuson’s picture

Issue summary: View changes
Andre-B’s picture

Status: Active » Fixed

gracefully 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.