Repository navigation
fix(javascript): add warning in replaceAllObjects for empty objects - #6608
Merged
eric-zaharia merged 12 commits intoJul 20, 2026
Merged
eric-zaharia merged 12 commits into
eric-zaharia merged 12 commits into
Conversation
Contributor
✔️ Code generated!
📊 Benchmark resultsBenchmarks performed on the method using a mock server, the results might not reflect the real-world performance.
|
Fluf22
reviewed
Jul 3, 2026
…s-empty-warning-20260626/javascript
… undefined warn args
The `with logger` test in each algoliasearch build variant fired an un-awaited setSettings call against unresolvable hosts; the leaked retries raced vitest pool teardown and intermittently failed the client javascript CI job even with all tests passing. Replace the real request with a mock requester returning a retryable 500, await the rejection, and assert the transporter's actual `Retryable failure` logger output (the old inner assertions never executed). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
eric-zaharia
deleted the
port/replaceallobjects-empty-warning-20260626/javascript
branch
July 20, 2026 11:43
algolia-api-clients-automation-bot Bot
added a commit
that referenced
this pull request
Jul 20, 2026
…6608) (generated) [skip ci] Co-authored-by: Eric Zaharia <94015633+eric-zaharia@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
algolia-api-clients-automation-bot Bot
added a commit
to algolia/algoliasearch-client-javascript
that referenced
this pull request
Jul 20, 2026
…generated) algolia/api-clients-automation#6608 Co-authored-by: algolia-api-clients-automation-bot[bot] <288895823+algolia-api-clients-automation-bot[bot]@users.noreply.github.com> Co-authored-by: Eric Zaharia <94015633+eric-zaharia@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
algolia-api-clients-automation-bot Bot
added a commit
to algolia/algoliasearch-client-swift
that referenced
this pull request
Jul 20, 2026
…generated) algolia/api-clients-automation#6608 Co-authored-by: algolia-api-clients-automation-bot[bot] <288895823+algolia-api-clients-automation-bot[bot]@users.noreply.github.com> Co-authored-by: Eric Zaharia <94015633+eric-zaharia@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🧭 What and Why
🎟 JIRA Ticket: API-500
Mirrors #6607 for JavaScript:
replaceAllObjectsandreplaceAllObjectsWithTransformationnow log a warning when called with an emptyobjectslist, since the helper would otherwise silently empty the index. Behavior is unchanged — the call still proceeds.Changes included:
replaceAllObjects(helpers.mustache) andreplaceAllObjectsWithTransformation(definition.mustache), plus aWarning:JSDoc note on both so it shows on IDE hover.Loggerif it implements the new optionalwarnmethod, and falls back toconsole.warnotherwise (newlogWarningutility inclient-common). Existing custom loggers keep compiling; the default null logger doesn't implementwarn, so out-of-the-box users still see the warning, while anyone with a real logger can route or silence it.createConsoleLoggerimplementswarn(gated at theInfothreshold), with tests.client-searchbundlewatch budget 10KB → 11KB (feat(javascript): add WithHTTPInfo methods #6682 left it at 9.97KB; the warning code tipped it over).with loggertests in the fouralgoliasearchbuild variants (browser/node/fetch/worker): each fired an un-awaited realsetSettingsrequest whose retries raced vitest pool teardown and intermittently failed theclient javascriptCI job with all tests green (it killed this PR's CI twice in a row). The tests now await a mock requester that returns a retryable 500 and assert the transporter's actualRetryable failurelog — the old inner assertions never executed.Usage