Skip to content

fix: ensure API errors parsing works even with multiple axios copies - #1909

Merged
szuperaz merged 1 commit into
release-v10from
fix-api-error-parsing-when-multiple-axios-instance-is-installed
Oct 13, 2026
Merged

szuperaz merged 1 commit into
release-v10from
fix-api-error-parsing-when-multiple-axios-instance-is-installed

Conversation

@szuperaz

@szuperaz szuperaz commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

https://linear.app/stream/issue/REACT-1225/ensure-stream-chat-js-parses-api-error-correctly-if-multiple-axios

Noticed this while I was checking duplicate message id handling in v10. In RN SampleApp, this doesn't work correctly because SampleApp has two copies of axios:

  • One from stream-chat installed by SampleApp
  • One from the SDK's stream-chat copy
  • When RN calls installNativeMultipartAdapter, it replaces SampleApp's axios adapter with the RN SDK's adapter copy and error instanceof AxiosError will always return false, which meant errors weren't parsed properly
  • The root cause is that RN shouldn't import from axios, fixed here: fix: don't import axios into RN SDK stream-chat-react-native#3853
  • Still, this fix makes sense regardless of RN fixed, stream-chat-js is updated to do a more robust isAxiosError(error) check, instead of relying on instanceof

@oliverlaz

Copy link
Copy Markdown
Member

@szuperaz @isekovanic shall we port this fix to v9 as well?

@isekovanic

Copy link
Copy Markdown
Contributor

@szuperaz @isekovanic shall we port this fix to v9 as well?

Yes, we kinda have to, I believe it's important

@szuperaz

Copy link
Copy Markdown
Contributor Author

We don't need to backport this to v9, because it didn't use instanceof AxiosError operator, it just rethrow the error with a cast: https://github.com/GetStream/stream-chat-js/blob/master/src/client.ts#L1403-L1404. Overall, a less safe solution, but it doesn't have this exact issue.

@szuperaz
szuperaz merged commit e0cfba9 into release-v10 Oct 13, 2026
6 checks passed
@szuperaz
szuperaz deleted the fix-api-error-parsing-when-multiple-axios-instance-is-installed branch October 13, 2026 12:47
github-actions Bot pushed a commit that referenced this pull request Oct 16, 2026
## [10.0.0-rc.22](v10.0.0-rc.21...v10.0.0-rc.22) (2026-10-16)

### ⚠ BREAKING CHANGES

* `StreamChatOptions` and `client.options` are removed.
`new StreamChat(key, config)` and `StreamChat.getInstance(key, config)` take
the configuration tree (`DeepPartial<InstanceConfigTree>`) as their second
argument; the `config` wrapper is dropped.
Option moves:
- `allowServerSideConnect`, `axiosRequestConfig`, `baseURL`, `browser`,
  `persistUserOnConnectionFailure` -> `client.<same name>`
- `notifications` -> `client.notificationManager`
- top-level axios fields (`timeout`, `httpsAgent`, ...) ->
  `client.axiosRequestConfig.<key>`
Example: `new StreamChat(key, { client: { allowServerSideConnect: true } })`.
`client.persistUserOnConnectionFailure` is no longer a field (use
`client.config.setConfig('client', { persistUserOnConnectionFailure })`);
`client.browser` and `client.node` are read-only getters.
`baseURL`, `axiosRequestConfig` and `notificationManager` are read at
construction, and the tree copies `axiosRequestConfig` instead of keeping
your object. See v9-to-v10-migration-guide-client-construction.md.

### Bug Fixes

* don't override local message attachments in createLinkPreviewsCo… ([#1885](#1885)) ([2aa5144](2aa5144))
* ensure API errors parsing works even with multiple axios copies ([#1909](#1909)) ([e0cfba9](e0cfba9))
* stability and perf fixes ([#1910](#1910)) ([080af2c](080af2c))
* type fixes from docs check; add docs snippet runner ([#1902](#1902)) ([2095fc1](2095fc1))
* type issues from platform docs check; add docs snippet test for the platform docs ([#1914](#1914)) ([c7706d2](c7706d2))
* **types:** add before_message_send_hook_system_messages to app settings response ([#1887](#1887)) ([724b4f7](724b4f7))

### Features

* add poll translation i18n fields ([#1878](#1878)) ([9d396e5](9d396e5)), closes [GetStream/chat#17029](https://github.com/GetStream/chat/issues/17029)
* poll optimistic updates ([#1895](#1895)) ([e3dac59](e3dac59))
* replace StreamChatOptions with the configuration tree ([#1911](#1911)) ([f05b861](f05b861))
@stream-ci-bot

Copy link
Copy Markdown

🎉 This PR is included in version 10.0.0-rc.22 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants