React native ios crashes on production with extraHeaders
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 63.2k
- Forks
- 10.3k
- Avg merge
- 11d 20h
- Merged PRs (30d)
- 2
Description
I need to pass a cookie, for the ingress session affinity, in order to maintain connection in multi pods,
so i set the extraHeaders:
when running the app in debug (in simulator or device) it works as expected, but after releasing ios app in testflight and testing, it crashes,
Fatal Exception: NSInvalidArgumentException
-[__NSArrayM length]: unrecognized selector sent to instance 0x283dcfde0
To Reproduce
Socket.IO server version: 4.4.0
Server
const io = new Socket(server, {
transports: ['websocket', 'polling'],
cors: {
origin: '*',
methods: ['GET', 'POST'],
credentials: true,
},
adapter: redisAdapter({
pubClient: redisClient,
subClient: redisClient.duplicate(),
}),
});
Socket.IO client version: 4.7.2
Client
initSocket(userId, cookie) {
this.socket = io(SOCKET_URL, {
query: `userId=${userId}`,
autoConnect: false,
transport: ['polling', 'websocket'],
extraHeaders: {
'Cookie': cookie,
},
});
}
Expected behavior
Connect without crash and maintain connection
Platform:
- Device: iphone 11
- OS: ios 17
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Start at the initSocket entry point and reproduce the provided extraHeaders configuration in an iOS production or TestFlight build, then inspect the NSInvalidArgumentException path. Done means the app connects without crashing on iOS 17 while retaining the requested session-affinity behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, javascript, react-native
- Domain
- mobile, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100