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
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

Successfully merging this pull request may close these issues.

4 participants