-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Woo POS] Coupons: Fetch from remote #15423
base: trunk
Are you sure you want to change the base?
Conversation
I'm not sure but I think we might have discussed to do the opposite? Storage first and remote later? |
|
@iamgabrielma Yes, I imagined we could do local first so the results would appear immediately, but update them with remote ones. How does the current IPP implementation work? As I understand, it's storage-first. My idea was to keep the same strategy as IPP to save time on coming up with alternatives.
A full-screen loading doesn't work here. A good point is that we need to ask a designer to consider how we display a loading state. Asked here p1742974197820449-slack-C070SJRA8DP |
This is how IPP works. I added a new coupon and returned to the screen. After a moment, a new coupon appeared. We could sync with the design on this as well. Maybe we could show a small loading indicator somewhere as well while the network request is ongoing. Wdyt? ScreenRecording_03-26-2025.09-36-12_1.mov |
That sounds good, I'll take a deeper look of how we do it in coupons in the app and make the changes to do local first -> then update with remote results. I'll see if I can change the loading indicator on this PR as well or add the "ghost rows" separately 👍 |
Closes: #15324
Description
This PR adds the ability to fetch coupons from remote to the coupons service. First, we attempt to fetch from the remote. If this fails, we'll attempt to fetch from storage. If fails, we just return an empty list of coupons (for the moment)
We might change the fetching strategy, for now it seemed adequate to attempt remote first and local storage later.
Screen.Recording.2025-03-26.at.13.58.58.mov
Testing information
coupons
buttonCouponsRemote.loadAllCoupons()
:RELEASE-NOTES.txt
if necessary.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: