This is an automated email from the ASF dual-hosted git repository.

astitcher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git

commit 32bcfccbd295bf576c8b5e02ed50afb8d6fbb7a1
Author: Andrew Stitcher <[email protected]>
AuthorDate: Thu Dec 18 21:06:28 2025 -0500

    PROTON-2873: [Python] Remove caching for delivery remote disposition
    
    We can't cache the remote disposition because it might be updated by the
    remote peer, but we have no way to know it has been changed in the
    delivery to invalidate the cache entry.
---
 python/proton/_delivery.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/python/proton/_delivery.py b/python/proton/_delivery.py
index 9639d7b06..4b588b2f9 100644
--- a/python/proton/_delivery.py
+++ b/python/proton/_delivery.py
@@ -74,6 +74,11 @@ if TYPE_CHECKING:
 
 
 class DispositionType(IntEnum):
+    EMPTY = 0
+    """
+    An empty disposition.
+    """
+
     RECEIVED = PN_RECEIVED
     """
     A non terminal state indicating how much (if any) message data
@@ -532,7 +537,7 @@ class TransactionalDisposition(LocalDisposition):
 
     def __init__(self, id, outcome=None):
         self._id = id
-        # Currently the transactional disposition C API can only hold the 
outcome type
+        # Currently the transactional disposition C API can only set the 
outcome type
         if isinstance(outcome, Disposition):
             self._outcome_type = outcome.type
         else:
@@ -612,13 +617,11 @@ class Delivery(Wrapper):
     def __init__(self, impl):
         if self.Uninitialized():
             self._local = None
-            self._remote = None
 
     @property
     def remote(self) -> RemoteDisposition:
-        if self._remote is None:
-            self._remote = RemoteDisposition(self._impl)
-        return self._remote
+        # Can't cache as there's no way to invalidate
+        return RemoteDisposition(self._impl)
 
     @property
     def local(self) -> LocalDisposition:


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to