Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

GraphQL variables with non-ASCII contents will make Apollo Client request throw error

未关闭
#1,482 2 条评论 1 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 2 天内回复

@cdn34dd 已经在做这个了。

开始于 2026年10月7日。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
42/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
android, graphql, react-native, typescript

调研方向

The crash is from putting GraphQL variables JSON (including emoji) into the _dd-custom-header-graph-ql-variables header that expo/fetch rejects on Android. Start in packages/react-native-apollo-client where variable tracking is configured and those custom headers are attached. Encode, strip, or skip non-ASCII header values for this path, then re-run an Apollo mutation with emoji in variables on Expo 57 Android.

由索引模型根据 Issue 内容生成。

描述

awaiting response bug
Describe the bug

After upgrading Expo to 57 we noticed this Android error ApolloError: fetch failed: Call to function 'NativeRequest.start' has been rejected. when performing GraphQL mutations with variables that contain emoji's. I believe this happens because the default fetch package changed from RN fetch to expo/fetch in Expo version 56. expo/fetch uses different native request classes which only accepts ASCII chars in headers of requests on Android. It seems like that @datadog/mobile-react-native-apollo-client does not properly set or unset these headers for this type of request.

Reproduction steps
  1. Use Expo 57
  2. Use @datadog/mobile-react-native-apollo-client in Apollo client
  3. Ensure variables are tracked
  4. Perform Apollo Client mutation on Android with emoji's inside variables
SDK logs
ApolloError: fetch failed: Call to function 'NativeRequest.start' has been rejected.
  → Caused by: java.lang.IllegalArgumentException: Unexpected char 0xd83d at 720 in _dd-custom-header-graph-ql-variables value: { [JSON with emoji @ char 720] }

      at ApolloError (index.android.bundle:1:6655429)
      at error (index.android.bundle:1:9155927)
      at notifySubscription (index.android.bundle:1:4252026)
      at error (index.android.bundle:1:6650787)
      at anonymous (index.android.bundle:1:8629368)
      at notifySubscription (index.android.bundle:1:4252026)
      at error (index.android.bundle:1:6650787)
      at anonymous (index.android.bundle:1:6605223)
      at forEach (native)
      at error (index.android.bundle:1:7956749)
      at notifySubscription (index.android.bundle:1:4252026)
      at error (index.android.bundle:1:6650787)
      at notifySubscription (index.android.bundle:1:4252026)
      at error (index.android.bundle:1:6650787)
      at error (index.android.bundle:1:8653842)
      at notifySubscription (index.android.bundle:1:4252026)
      at error (index.android.bundle:1:6650787)
      at error (index.android.bundle:1:8653842)
      at notifySubscription (index.android.bundle:1:4252026)
      at error (index.android.bundle:1:6650787)
      at notifySubscription (index.android.bundle:1:4252026)
      at error (index.android.bundle:1:6650787)
      at notifySubscription (index.android.bundle:1:4252026)
      at error (index.android.bundle:1:6650787)
      at error (index.android.bundle:1:8637041)
      at notifySubscription (index.android.bundle:1:4252026)
      at error (index.android.bundle:1:6650787)
      at anonymous (index.android.bundle:1:8633576)
      at tryCallOne (InternalBytecode.js:1:1296)
      at anonymous (InternalBytecode.js:1:4984)
Expected behavior

Apollo client requests should not fail because of dd graphql variable tracking.

Affected SDK versions

expo@57 + @datadog/[email protected]

Latest working SDK version

expo@55 + @datadog/[email protected]

Did you confirm if the latest SDK version fixes the bug?

Yes

Integration Methods

Yarn

React Native Version

No response

Package.json Contents

No response

iOS Setup

No response

Android Setup

No response

Device Information

No response

Other relevant information

No response

主要语言
TypeScript
星标
145
派生
65
平均合并
2 天 16 小时
30 天内合并 PR
20

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

DataDog/dd-sdk-reactnative 的其他 Issue

查看 DataDog/dd-sdk-reactnative 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。