Skip to content
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

Update when no changes in attribute data #1200

Open
KrzysztofPawlak opened this issue Feb 12, 2025 · 1 comment
Open

Update when no changes in attribute data #1200

KrzysztofPawlak opened this issue Feb 12, 2025 · 1 comment

Comments

@KrzysztofPawlak
Copy link

KrzysztofPawlak commented Feb 12, 2025

Test below, same data sent 2 times and it is always updated (number type). Same is for lenum.
For text type working as expected - no update when sent 2 times same data.

`

void test() {
    // given
    var pid = new AttributeBuilder()
            .name("pid")
            .value(1)
            .build();
    var productVariant = ProductVariantDraft.builder()
            .key("test_NR1BAG")
            .sku("test_NR1BAG")
            .attributes(List.of(pid))
            .build();
    var productDraft = ProductDraft.builder()
            .key("test_NR1BAG")
            .name(LocalizedStringBuilder.of().values(Map.of("en-GB", "test_NR1BAG")).build())
            .slug(LocalizedStringBuilder.of().values(Map.of("en-GB", "test_NR1BAG")).build())
            .productType(ProductTypeResourceIdentifierBuilder.of().key("goldenproduct").build())
            .build();
    productDraft.setMasterVariant(productVariant);
    var productSyncOptions = ProductSyncOptionsBuilder.of(api).build();

    // when
    new ProductSync(productSyncOptions)
            .sync(List.of(productDraft)).toCompletableFuture()
            .join();
    var result = new ProductSync(productSyncOptions)
            .sync(List.of(productDraft)).toCompletableFuture()
            .join();

    // then
    assertThat(result.getUpdated().get()).isZero(); // always fails
}

`

@lojzatran
Copy link
Collaborator

Hi @KrzysztofPawlak,

Thank you for reporting the issue. I confirm that I could reproduce it. I will check now how to tackle it and get back to you.

Best regards,
Lam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants