Skip to content

Conversation

@toupper
Copy link
Contributor

@toupper toupper commented Oct 24, 2025

WOOMOB-1154

Description

From this comment

We fetch the order remotely if it's not in the DB

Test Steps

Open POS after a clean install of the app, and ensure that the receipt is sent.

Images/gif

N/A

  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

@toupper toupper added this to the 23.6 milestone Oct 24, 2025
@toupper toupper requested a review from kidinov October 24, 2025 11:08
@toupper toupper added type: task An internally driven task. feature: point of sale POS project feature: POS labels Oct 24, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Oct 24, 2025

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App NameWooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commitea90d56
Direct Downloadwoocommerce-wear-prototype-build-pr14817-ea90d56.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Oct 24, 2025

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

App NameWooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commitea90d56
Direct Downloadwoocommerce-prototype-build-pr14817-ea90d56.apk

@kidinov kidinov self-assigned this Oct 28, 2025
orderMapper.toAppModel(it)
}

suspend fun fetchOrderById(orderId: Long): Order? {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be private?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, done in 4a8de22

}

suspend fun fetchOrderById(orderId: Long): Order? {
val result = withTimeoutOrNull(AppConstants.REQUEST_TIMEOUT) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it can be as simple as

    suspend fun fetchOrderById(orderId: Long): Order? {
        val result = orderStore.fetchSingleOrder(
            selectedSite.get(),
            orderId
        )

        return if (!result.isError) {
            getOrderById(orderId)
        } else {
            null
        }
    }

withTimeoutOrNull looks like it's redundant. There is already a request on timeout in the network layer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point, done in 0703601

Copy link
Contributor

@kidinov kidinov left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks. I left a couple of suggestions, please take a look

Base automatically changed from feat/WOOMOB-1154-POS-Order-details-email-refresh-after to trunk October 29, 2025 13:46
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is assigned to the milestone 23.6. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@toupper toupper enabled auto-merge October 29, 2025 16:06
@toupper toupper merged commit be188ce into trunk Oct 30, 2025
15 of 16 checks passed
@toupper toupper deleted the feat/WOOMOB-1154-POS-Order-email-receipt-fetch branch October 30, 2025 09:52
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.27%. Comparing base (022c591) to head (ea90d56).
⚠️ Report is 15 commits behind head on trunk.

Additional details and impacted files
@@            Coverage Diff            @@
##              trunk   #14817   +/-   ##
=========================================
  Coverage     38.27%   38.27%           
- Complexity    10089    10091    +2     
=========================================
  Files          2132     2132           
  Lines        120771   120779    +8     
  Branches      16568    16570    +2     
=========================================
+ Hits          46224    46232    +8     
+ Misses        69850    69849    -1     
- Partials       4697     4698    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: point of sale POS project feature: POS type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants