Skip to content

Bug: Functions not using processed data from create/transform functions #6

Description

@mosiac05

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions