Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-mautrix for openSUSE:Factory 
checked in at 2023-05-24 20:23:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-mautrix (Old)
 and      /work/SRC/openSUSE:Factory/.python-mautrix.new.1533 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-mautrix"

Wed May 24 20:23:21 2023 rev:10 rq:1088887 version:0.19.15

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-mautrix/python-mautrix.changes    
2023-05-18 15:20:16.170201514 +0200
+++ /work/SRC/openSUSE:Factory/.python-mautrix.new.1533/python-mautrix.changes  
2023-05-24 20:23:36.244623744 +0200
@@ -1,0 +2,7 @@
+Wed May 24 16:17:20 UTC 2023 - Matej Cepl <mc...@suse.com>
+
+- Update to 0.19.15:
+  - Fixed dispatching room ephemeral events (i.e. typing
+    notifications) in syncer.
+
+-------------------------------------------------------------------

Old:
----
  mautrix-python-0.19.14-gh.tar.gz

New:
----
  mautrix-python-0.19.15-gh.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-mautrix.spec ++++++
--- /var/tmp/diff_new_pack.4T0HrR/_old  2023-05-24 20:23:36.736626678 +0200
+++ /var/tmp/diff_new_pack.4T0HrR/_new  2023-05-24 20:23:36.744626725 +0200
@@ -25,7 +25,7 @@
 %endif
 
 Name:           python-mautrix
-Version:        0.19.14
+Version:        0.19.15
 Release:        0
 Summary:        A Python 3 asyncio Matrix framework
 License:        MPL-2.0

++++++ mautrix-python-0.19.14-gh.tar.gz -> mautrix-python-0.19.15-gh.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-0.19.14/CHANGELOG.md 
new/python-0.19.15/CHANGELOG.md
--- old/python-0.19.14/CHANGELOG.md     2023-05-16 11:44:21.000000000 +0200
+++ new/python-0.19.15/CHANGELOG.md     2023-05-24 11:47:19.000000000 +0200
@@ -1,3 +1,7 @@
+## v0.19.15 (2023-05-24)
+
+* *(client)* Fixed dispatching room ephemeral events (i.e. typing 
notifications) in syncer.
+
 ## v0.19.14 (2023-05-16)
 
 * *(bridge)* Implemented appservice pinging using MSC2659.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-0.19.14/mautrix/__init__.py 
new/python-0.19.15/mautrix/__init__.py
--- old/python-0.19.14/mautrix/__init__.py      2023-05-16 11:44:21.000000000 
+0200
+++ new/python-0.19.15/mautrix/__init__.py      2023-05-24 11:47:19.000000000 
+0200
@@ -1,4 +1,4 @@
-__version__ = "0.19.14"
+__version__ = "0.19.15"
 __author__ = "Tulir Asokan <tu...@maunium.net>"
 __all__ = [
     "api",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-0.19.14/mautrix/appservice/as_handler.py 
new/python-0.19.15/mautrix/appservice/as_handler.py
--- old/python-0.19.14/mautrix/appservice/as_handler.py 2023-05-16 
11:44:21.000000000 +0200
+++ new/python-0.19.15/mautrix/appservice/as_handler.py 2023-05-24 
11:47:19.000000000 +0200
@@ -85,9 +85,11 @@
             try:
                 token = request.headers["Authorization"].removeprefix("Bearer 
")
             except (KeyError, AttributeError):
+                self.log.trace("No access_token nor Authorization header in 
request")
                 return False
 
         if token != self.hs_token:
+            self.log.trace(f"Incorrect hs_token in request ({token!r} != 
{self.hs_token!r})")
             return False
 
         return True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-0.19.14/mautrix/client/syncer.py 
new/python-0.19.15/mautrix/client/syncer.py
--- old/python-0.19.14/mautrix/client/syncer.py 2023-05-16 11:44:21.000000000 
+0200
+++ new/python-0.19.15/mautrix/client/syncer.py 2023-05-24 11:47:19.000000000 
+0200
@@ -340,6 +340,13 @@
                     self._try_deserialize(Event, raw_event),
                     source=SyncStream.JOINED_ROOM | SyncStream.TIMELINE,
                 )
+
+            for raw_event in room_data.get("ephemeral", {}).get("events", []):
+                raw_event["room_id"] = room_id
+                tasks += self.dispatch_event(
+                    self._try_deserialize(EphemeralEvent, raw_event),
+                    source=SyncStream.JOINED_ROOM | SyncStream.EPHEMERAL,
+                )
         for room_id, room_data in rooms.get("invite", {}).items():
             events: list[dict[str, JSON]] = room_data.get("invite_state", 
{}).get("events", [])
             for raw_event in events:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-0.19.14/mautrix/util/proxy.py 
new/python-0.19.15/mautrix/util/proxy.py
--- old/python-0.19.14/mautrix/util/proxy.py    2023-05-16 11:44:21.000000000 
+0200
+++ new/python-0.19.15/mautrix/util/proxy.py    2023-05-24 11:47:19.000000000 
+0200
@@ -4,6 +4,7 @@
 import asyncio
 import json
 import logging
+import time
 import urllib.request
 
 from aiohttp import ClientConnectionError
@@ -93,8 +94,10 @@
     max_wait_seconds: int = 60,
     multiply_wait_seconds: int = 10,
     retryable_exceptions: tuple[Exception] = RETRYABLE_PROXY_EXCEPTIONS,
+    reset_after_seconds: int | None = None,
 ) -> T:
     errors = 0
+    last_error = 0
 
     while True:
         try:
@@ -116,3 +119,11 @@
                 f"{e.__class__.__name__} while trying to {name}"
             ):
                 await on_proxy_change()
+
+            # If sufficient time has passed since the previous error, reset the
+            # error count. Useful for long running tasks with rare failures.
+            if reset_after_seconds is not None:
+                now = time.time()
+                if last_error and now - last_error > reset_after_seconds:
+                    errors = 0
+                last_error = now

Reply via email to