summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2014-12-18 15:06:11 +0000
committerDavid Baker <dave@matrix.org>2014-12-18 15:06:11 +0000
commit0a6664493a6277d6b7b78b54e0b2a6da591ad158 (patch)
treea01e93cb31ca94d83dba6a9a381997b88f5b3a25
parentThank you, pyflakes (diff)
parentMerge branch 'hotfixes-v0.5.4' of github.com:matrix-org/synapse (diff)
downloadsynapse-0a6664493a6277d6b7b78b54e0b2a6da591ad158.tar.xz
Merge branch 'master' into pushers
-rw-r--r--CHANGES.rst21
-rw-r--r--VERSION2
-rw-r--r--contrib/jitsimeetbridge/unjingle/.swpbin12288 -> 0 bytes
-rw-r--r--synapse/__init__.py2
-rw-r--r--synapse/config/_base.py4
-rw-r--r--synapse/config/logger.py6
-rw-r--r--synapse/config/server.py7
-rw-r--r--synapse/federation/replication.py8
-rw-r--r--synapse/handlers/presence.py5
-rw-r--r--synapse/handlers/room.py6
-rw-r--r--synapse/rest/room.py4
-rw-r--r--synapse/storage/roommember.py4
-rw-r--r--synapse/streams/config.py6
13 files changed, 63 insertions, 12 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index 6779a36f72..0d36e8eeff 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -1,3 +1,24 @@
+Changes in synapse 0.5.4a (2014-12-13)
+======================================
+
+ * Fix bug while generating the error message when a file path specified in
+   the config doesn't exist.
+
+Changes in synapse 0.5.4 (2014-12-03)
+=====================================
+
+ * Fix presence bug where some rooms did not display presence updates for
+   remote users.
+ * Do not log SQL timing log lines when started with "-v"
+ * Fix potential memory leak.
+
+Changes in synapse 0.5.3c (2014-12-02)
+======================================
+
+ * Change the default value for the `content_addr` option to use the HTTP
+   listener, as by default the HTTPS listener will be using a self-signed
+   certificate.
+
 Changes in synapse 0.5.3 (2014-11-27)
 =====================================
 
diff --git a/VERSION b/VERSION
index dc74c5626d..64c6e2f460 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.5.3a
+0.5.4a
diff --git a/contrib/jitsimeetbridge/unjingle/.swp b/contrib/jitsimeetbridge/unjingle/.swp
deleted file mode 100644
index 449c08da56..0000000000
--- a/contrib/jitsimeetbridge/unjingle/.swp
+++ /dev/null
Binary files differdiff --git a/synapse/__init__.py b/synapse/__init__.py
index 658574dab9..7e49e1fd08 100644
--- a/synapse/__init__.py
+++ b/synapse/__init__.py
@@ -16,4 +16,4 @@
 """ This is a reference implementation of a synapse home server.
 """
 
-__version__ = "0.5.3a"
+__version__ = "0.5.4a"
diff --git a/synapse/config/_base.py b/synapse/config/_base.py
index 6870af10e8..846570811f 100644
--- a/synapse/config/_base.py
+++ b/synapse/config/_base.py
@@ -44,9 +44,9 @@ class Config(object):
             )
         if not os.path.exists(file_path):
             raise ConfigError(
-                "File % config for %s doesn't exist."
+                "File %s config for %s doesn't exist."
                 " Try running again with --generate-config"
-                % (config_name,)
+                % (file_path, config_name,)
             )
         return cls.abspath(file_path)
 
diff --git a/synapse/config/logger.py b/synapse/config/logger.py
index 8566296433..089d906fa5 100644
--- a/synapse/config/logger.py
+++ b/synapse/config/logger.py
@@ -52,12 +52,18 @@ class LoggingConfig(Config):
         if self.log_config is None:
 
             level = logging.INFO
+            level_for_storage = logging.INFO
             if self.verbosity:
                 level = logging.DEBUG
+                if self.verbosity > 1:
+                    level_for_storage = logging.DEBUG
 
             # FIXME: we need a logging.WARN for a -q quiet option
             logger = logging.getLogger('')
             logger.setLevel(level)
+
+            logging.getLogger('synapse.storage').setLevel(level_for_storage)
+
             formatter = logging.Formatter(log_format)
             if self.log_file:
                 handler = logging.FileHandler(self.log_file)
diff --git a/synapse/config/server.py b/synapse/config/server.py
index 814a4c349b..f8a0844b8c 100644
--- a/synapse/config/server.py
+++ b/synapse/config/server.py
@@ -35,8 +35,11 @@ class ServerConfig(Config):
         if not args.content_addr:
             host = args.server_name
             if ':' not in host:
-                host = "%s:%d" % (host, args.bind_port)
-            args.content_addr = "https://%s" % (host,)
+                host = "%s:%d" % (host, args.unsecure_port)
+            else:
+                host = host.split(':')[0]
+                host = "%s:%d" % (host, args.unsecure_port)
+            args.content_addr = "http://%s" % (host,)
 
         self.content_addr = args.content_addr
 
diff --git a/synapse/federation/replication.py b/synapse/federation/replication.py
index 312d69fcaa..01f87fe423 100644
--- a/synapse/federation/replication.py
+++ b/synapse/federation/replication.py
@@ -853,7 +853,10 @@ class _TransactionQueue(object):
 
                 # Ensures we don't continue until all callbacks on that
                 # deferred have fired
-                yield deferred
+                try:
+                    yield deferred
+                except:
+                    pass
 
             logger.debug("TX [%s] Yielded to callbacks", destination)
 
@@ -865,7 +868,8 @@ class _TransactionQueue(object):
             logger.exception(e)
 
             for deferred in deferreds:
-                deferred.errback(e)
+                if not deferred.called:
+                    deferred.errback(e)
 
         finally:
             # We want to be *very* sure we delete this after we stop processing
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py
index b55d589daf..815d40f166 100644
--- a/synapse/handlers/presence.py
+++ b/synapse/handlers/presence.py
@@ -651,11 +651,16 @@ class PresenceHandler(BaseHandler):
             logger.debug("Incoming presence update from %s", user)
 
             observers = set(self._remote_recvmap.get(user, set()))
+            if observers:
+                logger.debug(" | %d interested local observers %r", len(observers), observers)
 
             rm_handler = self.homeserver.get_handlers().room_member_handler
             room_ids = yield rm_handler.get_rooms_for_user(user)
+            if room_ids:
+                logger.debug(" | %d interested room IDs %r", len(room_ids), room_ids)
 
             if not observers and not room_ids:
+                logger.debug(" | no interested observers or room IDs")
                 continue
 
             state = dict(push)
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py
index 88955160c5..a000b44036 100644
--- a/synapse/handlers/room.py
+++ b/synapse/handlers/room.py
@@ -519,7 +519,11 @@ class RoomMemberHandler(BaseHandler):
             user_id=user.to_string(), membership_list=membership_list
         )
 
-        defer.returnValue([r.room_id for r in rooms])
+        # For some reason the list of events contains duplicates
+        # TODO(paul): work out why because I really don't think it should
+        room_ids = set(r.room_id for r in rooms)
+
+        defer.returnValue(room_ids)
 
     @defer.inlineCallbacks
     def _do_local_membership_update(self, event, membership, snapshot,
diff --git a/synapse/rest/room.py b/synapse/rest/room.py
index cc6ffb9aff..3147d7a60b 100644
--- a/synapse/rest/room.py
+++ b/synapse/rest/room.py
@@ -327,7 +327,9 @@ class RoomMessageListRestServlet(RestServlet):
     @defer.inlineCallbacks
     def on_GET(self, request, room_id):
         user = yield self.auth.get_user_by_req(request)
-        pagination_config = PaginationConfig.from_request(request)
+        pagination_config = PaginationConfig.from_request(request,
+            default_limit=10,
+        )
         with_feedback = "feedback" in request.args
         handler = self.handlers.message_handler
         msgs = yield handler.get_messages(
diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py
index c37df59d45..05b275663e 100644
--- a/synapse/storage/roommember.py
+++ b/synapse/storage/roommember.py
@@ -218,7 +218,9 @@ class RoomMemberStore(SQLBaseStore):
             "ON m.event_id = c.event_id "
             "WHERE m.membership = 'join' "
             "AND (%(clause)s) "
-            "GROUP BY m.room_id HAVING COUNT(m.room_id) = ?"
+            # TODO(paul): We've got duplicate rows in the database somewhere
+            #   so we have to DISTINCT m.user_id here
+            "GROUP BY m.room_id HAVING COUNT(DISTINCT m.user_id) = ?"
         ) % {"clause": user_list_clause}
 
         args = list(user_id_list)
diff --git a/synapse/streams/config.py b/synapse/streams/config.py
index 0317e78c08..2114c940e7 100644
--- a/synapse/streams/config.py
+++ b/synapse/streams/config.py
@@ -47,7 +47,8 @@ class PaginationConfig(object):
         self.limit = int(limit) if limit is not None else None
 
     @classmethod
-    def from_request(cls, request, raise_invalid_params=True):
+    def from_request(cls, request, raise_invalid_params=True,
+                     default_limit=None):
         def get_param(name, default=None):
             lst = request.args.get(name, [])
             if len(lst) > 1:
@@ -84,6 +85,9 @@ class PaginationConfig(object):
         if limit is not None and not limit.isdigit():
             raise SynapseError(400, "'limit' parameter must be an integer.")
 
+        if limit is None:
+            limit = default_limit
+
         try:
             return PaginationConfig(from_tok, to_tok, direction, limit)
         except: