Hello @Daniel Lindberg
You are right. There seems to be miss. Any update or publish we make using standard API, it usually updates the data in two tables CatalogContentProperty and ecfVersionProperty. In the case of batch API because it does not add a new version, it never updated the version table and as a result we dont see the data for DisplayName accurately.
Hello @Quan Mai Please confirm if there is any workaround to trigger the change accurately?
NOTE: Quan, Mentioning your name as I had seen the feature on your blog https://world.optimizely.com/blogs/Quan-Mai/Dates/2019/10/new-simple-batch-saving-api-for-commerce/
@Daniel Linberg: I previously reported 2 bugs related to batch api, one of them: https://world.optimizely.com/support/bug-list/bug/COM-10634
I've tried using api a couple of times in different versions, but I have seen same issue arise with values not reflected in catalog UI.
Update: I just ran a new test in commerce 13.28 - and it seems both issues are resolved, COM-10634 and COM-10609.
Changes on existing items are reflected in UI and I don't get errors creating new products.
@Mari Jørgensen I'm getting this error on commerce 13.31.1, so maybe there are some other packages and/or configuration at play.
It should work, for both creating and updating catalog contents. IIRC (yes I wrote those code, but it has been 2 years now), if the content is new (i.e. being created), it will fall back to the normal content creation path. I can ask the QAs to look into this however.
QAs looked into this, and it looks like you will need this setting (you are probably setting it to true)
<add key="DisableVersionSync" value="false" />
It didn't work for me. I'm still getting the same result. I didn't have DisableVersionSync in my config at all, but I added it just to be sure that it didn't default to "true". I also injected IApplicationContext to verify that IApplicationContext.DisableVersionSync was false when running.
If you just use the normal non batch API to create a new content, does it work for you?
Yes it works. And as soon as I create or update a product through the standard API the batch API seems to work too. It can be verified through my sample code above. And through this set of steps:
When I tested create through the batch api, I could see that item was not published (just created) - could the publish state be a factor?
I am seeing some unexpected behavior when using the content batch api. I have prepared some sample code to explain what I’m doing and the results I’m getting:
I’m using the debugger to test different combinations of the batch api and the standard api.
The problem is that the content api and the commerce catalog ui doesn’t seem to be in sync. If I create a new product through the batch api it’s missing properties such as display name in the commerce catalog ui. I’ve run different tests, but here’s a test sequence that shows the problem:
It looks like something happens when the product is created or updated through the standard api. All subsequent calls to the batch api work as expected. If I don’t create/update the product through the standard api the display name never gets set. I have restarted several times to get around potential caching and I’m still getting the same results.
Am I doing something wrong?