The push/1, push_list/1, and get_receipts/1 functions call data transformation functions (PushMessage.create(), PushMessage.create_from_list(), PushMessage.create_receipt_id_list()) but discard their return values, then use the original unprocessed data in subsequent API calls.
Expected Behavior:
The functions should use the processed/transformed data returned by the PushMessage.create* functions when making API calls to the push notification service.
Actual Behavior:
The functions discard the return values from the transformation functions and use the original raw input data, potentially causing API errors or unexpected behavior.
Affected Functions:
push/1
push_list/1
get_receipts/1
Code Examples
Current (Buggy) Implementation:
def push(message) when is_map(message) do
message
|> PushMessage.create() # ❌ Return value discarded
PushNotification.post!("send", message) # ❌ Uses original message
|> Parser.parse()
end
Expected (Fixed) Implementation:
def push(message) when is_map(message) do
processed_message = PushMessage.create(message) # ✅ Capture return value
PushNotification.post!("send", processed_message) # ✅ Use processed data
|> Parser.parse()
end
The
push/1,push_list/1, andget_receipts/1functions call data transformation functions (PushMessage.create(),PushMessage.create_from_list(),PushMessage.create_receipt_id_list()) but discard their return values, then use the original unprocessed data in subsequent API calls.Expected Behavior:
The functions should use the processed/transformed data returned by the
PushMessage.create*functions when making API calls to the push notification service.Actual Behavior:
The functions discard the return values from the transformation functions and use the original raw input data, potentially causing API errors or unexpected behavior.
Affected Functions:
push/1push_list/1get_receipts/1Code Examples
Current (Buggy) Implementation:
Expected (Fixed) Implementation: