[bug]: BC Break starting v4.10.0 for batch operations in SearchClient
@damcou đang làm issue này rồi.
Từ ngày 14/1/2025.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Description
The following commit changed the method signature of multiple SearchClient methods, causing existing implementations to break when updating to algoliasearch-client-php v4.10.0 or higher:
https://github.com/algolia/algoliasearch-client-php/commit/50bc69c75c379f5fb626ac014b9a340d469987b5#diff-54160c7bd8737a7321b4384faa37eda8798b45865a44cab860fb736b08a60057R2945-R2962
Since the commit adds a new parameter in the middle of the established ones, existing code calling these methods with requestOptions (and possibly waitForTasks) will break as the arguments are now misaligned. Missing type checks furthermore causes this to surface as an obscure error (see log output). Only implementations that explicitly used named arguments aren't affected.
The method doc-block also erroneously hints the new batchSize parameter type to be an array.
Minor releases shouldn't contain BC-breaking changes for publicly supported methods. If a new parameter is added, it should be appended at the end as to not break existing method calls for dependents.
Client
Search
Version
4.10, 4.12
Relevant log output
In SearchClient.php line 3112:
[Error]
Cannot use a scalar value as an array
Exception trace:
at /srv/sylius/vendor/algolia/algoliasearch-client-php/lib/Api/SearchClient.php:3112
Algolia\AlgoliaSearch\Api\SearchClient->sendRequest() at /srv/sylius/vendor/algolia/algoliasearch-client-php/lib/Api/SearchClient.php:355
Algolia\AlgoliaSearch\Api\SearchClient->batch() at /srv/sylius/vendor/algolia/algoliasearch-client-php/lib/Api/SearchClient.php:3028
Algolia\AlgoliaSearch\Api\SearchClient->chunkedBatch() at /srv/sylius/vendor/algolia/algoliasearch-client-php/lib/Api/SearchClient.php:2961
Algolia\AlgoliaSearch\Api\SearchClient->saveObjects() at /srv/sylius/src/Client/AlgoliaIndexClientV4.php:27
- Ngôn ngữ chính
- PHP
- Star
- 696
- Fork
- 111
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của algolia/algoliasearch-client-php
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
[bug]: Please tag a new major version when introducing BC breaksCó thể làm lại được @Fluf22 đã nhận 216 ngày trước và không có pull request nào đang mở. Đang mở
algolia/algoliasearch-client-php#760 · 5 bình luận · 1 reaction · 1 người được giao ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
algolia/algoliasearch-client-php#753 · 1 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
[bug]: Use enumsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
algolia/algoliasearch-client-php#748 · 1 bình luận ·
Tất cả issue của algolia/algoliasearch-client-php
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
HE-Arc/le-panier-du-coin#49 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
15.0
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
bug: juros do parcelamento travados em 1x no gateway Rede Débito e Crédito 3DS (woo-rede 5.6.0)Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
LinkNacional/woo-rede#367 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Lazyload SVG placeholder runs uncached attachment lookups with JSON-escaped URLs on REST responsesĐang mởcustomer report
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Codeinwp/optimole-wp#1253 ·
Maintainer thường phản hồi trong vòng 1 ngày