# HG changeset patch # User Atul Varma # Date 1272331016 25200 # Node ID d48599d7a9ae1b605b1d267d601f95ed30f13aa7 # Parent ee0a4597c06792a2d61248bc5253c02960481bd4 Fixed a bug where users going from unauthenticated -> authenticated wouldn't see their private bugs unless they hit 'refresh' diff -r ee0a4597c067 -r d48599d7a9ae js/modules/app.js --- a/js/modules/app.js Mon Apr 26 17:45:02 2010 -0700 +++ b/js/modules/app.js Mon Apr 26 18:16:56 2010 -0700 @@ -81,11 +81,6 @@ }; Require.modules["app/bugzilla-auth"] = function(exports, require) { - function onLoad(event) { - var xhr = event.target; - console.log("load", xhr); - } - function onError(event) { var xhr = event.target; require("errors").log("bugzilla-api-error"); @@ -105,7 +100,6 @@ var xhr = Bugzilla.ajax.call(this, options); - xhr.addEventListener("load", onLoad, false); xhr.addEventListener("error", onError, false); return xhr; @@ -622,20 +616,22 @@ changed_after: timeAgo(MS_PER_WEEK * 14) }; - function update(myUsername, forceUpdate) { + function update(myUsername, isAuthenticated, forceUpdate) { xhrQueue.clear(); - report("#code-reviews", myUsername, forceUpdate, + var key = myUsername + "_" + (isAuthenticated ? "PRIVATE" : "PUBLIC"); + + report("#code-reviews", key, forceUpdate, {status: ["NEW", "UNCONFIRMED", "ASSIGNED", "REOPENED"], flag_DOT_requestee: myUsername}); - report("#assigned-bugs", myUsername, forceUpdate, + report("#assigned-bugs", key, forceUpdate, {status: ["NEW", "UNCONFIRMED", "ASSIGNED", "REOPENED"], email1: myUsername, email1_type: "equals", email1_assigned_to: 1}); - report("#reported-bugs", myUsername, forceUpdate, + report("#reported-bugs", key, forceUpdate, {status: ["NEW", "UNCONFIRMED", "ASSIGNED", "REOPENED"], email1: myUsername, email1_type: "equals", @@ -644,7 +640,7 @@ email2_type: "not_equals", email2_assigned_to: 1}); - report("#cc-bugs", myUsername, forceUpdate, + report("#cc-bugs", key, forceUpdate, {status: ["NEW", "UNCONFIRMED", "ASSIGNED", "REOPENED"], email1: myUsername, email1_type: "equals", @@ -654,7 +650,7 @@ email2_assigned_to: 1, email2_reporter: 1}); - report("#fixed-bugs", myUsername, forceUpdate, + report("#fixed-bugs", key, forceUpdate, {resolution: ["FIXED"], changed_after: timeAgo(MS_PER_WEEK), email1: myUsername, @@ -669,7 +665,7 @@ execute: function execute() { var user = require("app/login").get(); if (user.isLoggedIn) - update(user.username, true); + update(user.username, user.isAuthenticated, true); } }; @@ -678,7 +674,7 @@ require("app/login").whenChanged( function changeSearchCriteria(user) { if (user.isLoggedIn) { - update(user.username, false); + update(user.username, user.isAuthenticated, false); } }); };