-
Notifications
You must be signed in to change notification settings - Fork 26
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
[WISHLISTS-25] fix the wishlist api #95
Conversation
Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖 Please select which version do you want to release:
And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.
|
Beep boop 🤖 I noticed you didn't make any changes at the
In order to keep track, I'll create an issue if you decide now is not a good time
|
643113a
to
592e365
Compare
592e365
to
be48c2a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend combining FirstScroll and SubScroll into one function that uses the token if present otherwise sets size.
dotnet/Data/WishListRepository.cs
Outdated
@@ -229,12 +240,13 @@ public async Task VerifySchema() | |||
} | |||
} | |||
|
|||
public async Task<WishListsWrapper> GetAllLists() | |||
private async Task<string> firstScroll() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use Pascal Case: FirstScroll
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Brian, thank you for the comments.
I tried to run the first scroll call and all the sub calls in the postman and found that they all have the X-VTEX-MD-TOKEN in the header. The first sub call always has the same token as the initial call, and other sub calls' tokens can be updated by themselves sometimes.
So I think checking if the token is present is not a good idea since we want to make sure all sub calls use the token from the first scroll call.
I will update functions to Pascal Case.
var response = await client.SendAsync(request); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the token need to be reset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the scroll document https://developers.vtex.com/vtex-rest-api/reference/scrolldocuments, all subsequent requests use the same token from the first call
63a71a9
to
a1f2be9
Compare
a1f2be9
to
28dc87a
Compare
[vtex-apps_wish-list-ts] Kudos, SonarCloud Quality Gate passed! |
[vtex-apps_wish-list-dotnet] Kudos, SonarCloud Quality Gate passed! |
Your PR has been merged! App is being published. 🚀 After the publishing process has been completed (check #vtex-io-releases) and doing A/B tests with the new version, you can deploy your release by running:
After that your app will be updated on all accounts. For more information on the deployment process check the docs. 📖 |
What problem is this solving?
Bugfix for the wishlist API, the wishlist API is using the scroll api . There were no subsequent scroll requests so the API couldn't return all the wishlist records. This change sets the scroll size to 200 so that the scroll will return 200 records in each call.
How to test it?
Add a product to your wishlist so that your record will be the most recent one. Then download the wishlist sheet and search to see if your newest record is there.