galafis commented on issue #51102:
URL: https://github.com/apache/airflow/issues/51102#issuecomment-4069338485

   I've analyzed the `AppriseHook` source code and the guidance from the 
Apprise developer. The fix is focused and backward-compatible:
   
   **Root Cause:** In `AppriseHook.notify()` and `async_notify()`, the 
`Apprise` object is created with `apprise.Apprise()` without any 
`AppriseAsset`, which means persistent storage is never enabled. This causes 
repeated logins for services like Matrix that support session caching.
   
   **Proposed Fix:**
   1. Add optional `storage_path` and `storage_mode` parameters to 
`AppriseHook.__init__()`
   2. When `storage_path` is set, build an `AppriseAsset(storage_path=..., 
storage_mode=...)` and pass it to `apprise.Apprise(asset=asset)`
   3. Apply the same pattern in both `notify()` and `async_notify()` methods
   4. Default behavior remains unchanged when `storage_path` is `None` (no 
persistent storage)
   5. Also support reading `storage_path` from the connection's `extra` field 
for configuration flexibility
   
   This keeps it minimal and backward-compatible while solving the Matrix 
rate-limiting issue. Opening a PR shortly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to