Repository navigation
Description
Is this a regression?
Yes
Severity
🟠 Major – significantly affects usability
Please provide the branch(es) you discovered this issue in
v93
Environment Details
edge
Please provide a minimal set of steps to reproduce the issue
-
Create a custom shopping cart check in the API according to the official documentation.
see: https://github.com/OneIdentity/IdentityManager.ApiSdk/blob/v93/doc/05-composition-api-plugins.md -
Fix the custom shopping cart item check by adding an empty constructor to the Sample CartItemCheck.
(Annotation if you don't fix it you will get an error during runtime)
add: "public SampleCheck() { } " to the code
public class SampleCheck : ICartItemCheck {
private readonly ICartItemCheckContext _context;
public SampleCheck() { } '<-- add this line !!!
public SampleCheck(ICartItemCheckContext context) {
...
=> result; no servor occurs during runtime
- Modify the SampleCheck- ProcessAsync-Task, in that way that the task always sets the Status to: CheckStatus.Error
internal async Task ProcessAsync(CancellationToken ct = default) {
Status = CheckStatus.Error; '<-- set Status to Error, independent from context
}
public CheckStatus Status { get; set; } = CheckStatus.Pending;
- Add three products to the shopping cart
- Goto the shopping cart
- Perform a check to the shopping cart
Description
The modified SampleCheck: ICartItemCheck was modified to return always CheckStatus: Error;
Hence all(!!!) products should have the CheckStatus: Error
But in UI-Result only one Product has a CheckStatus: Error, where else the other two products are marked with CheckStatus: ok:
Describe what you expected to happen versus what actually happened
As the SampleCheck always returns CheckStatus.Error in this case all three products should be marked to have an "Fehler" in the ui
Relevant logs or console output
Add a screenshot(s) if that helps illustrate the problem
No response
Suggested Fix
No response
Anything else?
The fact that the SampleCheck - class is instantiated without an context is an error in itself, because a SampleCheck - instance without a context cannot decide if the status is error or success and therefore it makes no sense. But exactly this happens. So I assume that is already the error. I assume if you find the codeline where the ICartItemCheck is instantiated without a context you found the bug.
Before submitting...
- I have searched for existing issues that match this one on github and on the community support page
- I have included all necessary details to reproduce this issue
Activity
asattler commentedon Jul 13, 2026
Hi Peter,
thanks for raising this. I didn't notice, even though my project is live with 9.3.1 for 6 months now...
I was able to verify your issue and I also found a possible solution.
The misunderstanding (or better: wrong or imcomplete example in the SDK) is that it's not clear that the ICartCheck.CheckAsync is called for each item in the cart. Which means that with example code:
you're always returning an array with one check to proceed, which seems to overwrite the previous collection.
So instead of doing this, create a list and maintain it.
So my proposed solution is (DO NOT USE THIS APPROACH, SEE MY LARTER POST):
I did a short test and it seems to work.
Feel free to review and use :)
BR
Andreas
asattler commentedon Jul 13, 2026
My proposed solution doesn't seem to be the 100%. The web results now show multiple results per item...
Seems like I need to invest a little more time. If you find a solution, please share with us @gitpm :)
asattler commentedon Jul 14, 2026
So, I re-checked my code and the behavior I can monitor.
CheckAsyncis called for every item,ProcessAsyncis called once per cart.This lead me to the following assumption:
I did a short test, and it seems to work as expected.
gitpm commentedon Jul 14, 2026
Hi Andreas,
Thanks a lot for sharing your solution.
It looks straightforward, and you're right. In my opinion, it makes perfect sense to create a separate ICartItemCheck for each ShoppingCartItem.
I just created a simple cross-check test, and it seems to work in my project as well.
Nevertheless, I noticed that the empty constructor of the ICartItemCheck class is still being invoked for some unknown reason. But as long as the result is correct, I don't really care why it happens.
petermuehlhoefer commentedon Aug 3, 2026
Finally I solved the problem with this implementation:
Models and Interfaces
First of all I extended the ICartItemCheck by a ProcessCheckAsync-Methode in order to set the ICartItemCheck -Attributes within the instance of the ICartItemCheck-Interface-class.
CartCheckProvider
CartCheck
Then it goes straight forward:
Example of an ICccCartItemCheckHandler provided by the ShoppingCartItemCheckFactory
github-actions commentedon Sep 2, 2026
This issue has not seen any action for a while! Closing for now, but it can be reopened at a later date.