Skip to content

Commit

Permalink
[flows] deprecate FlowRequest.is_health_check and `FlowRequestActio…
Browse files Browse the repository at this point in the history
…nType.PING`
  • Loading branch information
david-lev committed Jan 2, 2025
1 parent 8d1560c commit 99d9442
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pywa/types/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class FlowRequestActionType(utils.StrEnum):
INIT: if the request is triggered when opening the flow (The :class:`FlowButton` was sent with flow_action_type set to ``FlowActionType.DATA_EXCHANGE``)
BACK: if the request is triggered when pressing back (The screen has ``refresh_on_back`` set to ``True``)
DATA_EXCHANGE: if the request is triggered when submitting the screen (And the :class:`Action` name is ``FlowActionType.DATA_EXCHANGE``)
PING: if the request is triggered by a health check (Ignore this requests by leaving ``handle_health_check`` to ``True``)
PING: Deprecated. This request is handled automatically by pywa and not passed to the callback.
NAVIGATE: if the :class:`FlowButton` sent with ``FlowActionType.NAVIGATE`` and the screen is not in the routing model (the request will contain an error)
"""

Expand Down Expand Up @@ -317,10 +317,13 @@ def has_error(self) -> bool:
@property
def is_health_check(self) -> bool:
"""
Check if the request is a health check.
When True, if flow endpoint register with ``handle_health_check=True``,
pywa will not call the callback and will return a health check response.
Deprecated. Health check is handled automatically by pywa.
"""
warnings.warn(
"This property is deprecated because the health check is handled automatically by pywa.",
DeprecationWarning,
stacklevel=2,
)
return self.action == FlowRequestActionType.PING

def decrypt_media(
Expand Down

0 comments on commit 99d9442

Please sign in to comment.