Skip to content

Conversation

iamgabrielma
Copy link
Contributor

@iamgabrielma iamgabrielma commented Sep 8, 2025

Description

Cleans up feature flag service by removing pointOfSaleReceipts, which has been in production for a while.

Testing info

Sending receipts should work normally. For more granular testing:

  • Add a breakpoint in POSReceiptService.sendReceipt(...)
  • In a store with WC10+, process a transaction and attempt to send a receipt. Observe that we land in receiptsRemote.sendPOSReceipt()
  • Update POSReceiptEligibilityConstants.wcPluginMinimumVersion to something like "15.0.0"
  • Process a transaction and attempt to send a receipt. Observe that we land in receiptsRemote.sendReceipt() instead.

@@ -110,29 +106,23 @@ protocol PointOfSaleOrderControllerProtocol {

@MainActor
func sendReceipt(recipientEmail: String) async throws {
var isEligibleForPOSReceipt: Bool?
var isEligibleForPOSReceipt: Bool = false
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAU we have no reason for this to be nil, since it's either eligible or it isn't. Also allows to simplify the value we pass to the catch block and the track event.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, if there was no order, or orderService.updatePOSOrder threw an error, we'd track the receiptEmailFailed event without eligible_for_pos_receipt (thanks to the compactMapValues.)

Now we'll log it as false even if the real answer would have been true.

Perhaps we should just set the isEligible at the top instead of after updating the order. The only thing it uses is the siteID, which isn't going to change from the order update, surely.

@iamgabrielma iamgabrielma added type: task An internally driven task. feature: POS labels Sep 8, 2025
@iamgabrielma iamgabrielma added this to the 23.3 milestone Sep 8, 2025
@iamgabrielma iamgabrielma marked this pull request as ready for review September 8, 2025 14:28
@wpmobilebot
Copy link
Collaborator

App Icon📲 You can test the changes from this Pull Request in WooCommerce iOS Prototype by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS Prototype
Build Numberpr16103-08ece84
Version23.2
Bundle IDcom.automattic.alpha.woocommerce
Commit08ece84
Installation URL2ptaaii0abt98
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@joshheald joshheald self-assigned this Sep 9, 2025
Copy link
Contributor

@joshheald joshheald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cleaning this up. One point about analytics changes this'll cause though...

@@ -110,29 +106,23 @@ protocol PointOfSaleOrderControllerProtocol {

@MainActor
func sendReceipt(recipientEmail: String) async throws {
var isEligibleForPOSReceipt: Bool?
var isEligibleForPOSReceipt: Bool = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, if there was no order, or orderService.updatePOSOrder threw an error, we'd track the receiptEmailFailed event without eligible_for_pos_receipt (thanks to the compactMapValues.)

Now we'll log it as false even if the real answer would have been true.

Perhaps we should just set the isEligible at the top instead of after updating the order. The only thing it uses is the siteID, which isn't going to change from the order update, surely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: POS type: task An internally driven task.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants