summary refs log tree commit diff
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-09-08 13:54:09 -0700
committerKegan Dougal <kegan@matrix.org>2014-09-08 13:54:09 -0700
commitda9b7b03688e40c0ed5b14ab0e33fb77b6d8b931 (patch)
tree65ceb0a411e4a8bfb9736585b5c8b115fa07ef87
parentFloat right the num users, apply room highlight to user count. (diff)
downloadsynapse-da9b7b03688e40c0ed5b14ab0e33fb77b6d8b931.tar.xz
Added big massive TODOs on a huge design problem with initial sync
Diffstat (limited to '')
-rw-r--r--webclient/components/matrix/event-stream-service.js2
-rw-r--r--webclient/recents/recents-controller.js19
2 files changed, 20 insertions, 1 deletions
diff --git a/webclient/components/matrix/event-stream-service.js b/webclient/components/matrix/event-stream-service.js
index 4c0091dedb..1bc850a8fa 100644
--- a/webclient/components/matrix/event-stream-service.js
+++ b/webclient/components/matrix/event-stream-service.js
@@ -105,6 +105,8 @@ angular.module('eventStreamService', [])
         var deferred = $q.defer();
 
         // FIXME: We are discarding all the messages.
+        // XXX FIXME TODO : The discard works because we are doing this all over
+        // again on EVERY INSTANTIATION of the recents controller.
         matrixService.initialSync(1, false).then(
             function(response) {
                 var rooms = response.data.rooms;
diff --git a/webclient/recents/recents-controller.js b/webclient/recents/recents-controller.js
index fcb203b36c..b4762acd1d 100644
--- a/webclient/recents/recents-controller.js
+++ b/webclient/recents/recents-controller.js
@@ -16,6 +16,12 @@
 
 'use strict';
 
+// XXX FIXME TODO
+// We should NOT be dumping things into $rootScope!!!! We should NOT be
+// making any requests here, and should READ what is already in the 
+// rootScope from the event handler service!!!
+// XXX FIXME TODO
+
 angular.module('RecentsController', ['matrixService', 'matrixFilter', 'eventHandlerService'])
 .controller('RecentsController', ['$rootScope', '$scope', 'matrixService', 'eventHandlerService', 
                                function($rootScope, $scope, matrixService, eventHandlerService) {
@@ -28,6 +34,11 @@ angular.module('RecentsController', ['matrixService', 'matrixFilter', 'eventHand
     // in order to highlight a specific room in the list
     $rootScope.recentsSelectedRoomID;
 
+    // XXX FIXME TODO : We should NOT be doing this here, which could be
+    // repeated for every controller instance. We should be doing this in
+    // event handler service instead. In additon, this will break if there
+    // isn't a recents controller visible when the last message comes in :/
+    
     var listenToEventStream = function() {
         // Refresh the list on matrix invitation and message event
         $rootScope.$on(eventHandlerService.MEMBER_EVENT, function(ngEvent, event, isLive) {
@@ -58,7 +69,13 @@ angular.module('RecentsController', ['matrixService', 'matrixFilter', 'eventHand
         if ($rootScope.rooms) {
             return;
         }
-
+        
+        // XXX FIXME TODO
+        // We should NOT be dumping things into $rootScope!!!! We should NOT be
+        // making any requests here, and should READ what is already in the 
+        // rootScope from the event handler service!!!
+        // XXX FIXME TODO
+        
         $rootScope.rooms = {};
         
         // Use initialSync data to init the recents list