Skip to content

WebSocket bufferedAmount is always undefined #33810

Description

@hrjr4433

Description

WebSocket's bufferedAmount is always undefined. Either iOS or Android, after connecting to URL and sending data, socket.bufferedAmount is undefined.

Version

0.66.2

Output of npx react-native info

System:
OS: macOS 12.1
CPU: (8) x64 Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz
Memory: 613.17 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 15.3.0 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 7.19.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.2 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK:
System Images: android-26 | Google APIs Intel x86 Atom, android-26 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 2021.1 AI-211.7628.21.2111.8309675
Xcode: 13.3.1/13E500a - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_265 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.66.2 => 0.66.2
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

  1. Initialize a WebSocket, then check bufferedAmount is undefined.
  2. Send some data, then check bufferedAmount is undefined.

Snack, code example, screenshot, or link to a repository

const sock = new WebSocket(url);

console.log(sock.bufferedAmount); // it's undefined

const data = new Uint8Array(8192); // (1<<13) = 8kBytes
sock.send(data);

console.log(sock.bufferedAmount); // it's also undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    Impact: BugThe issue represents a bug somewhereNeeds: TaskThis issue has been triaged but it does not have an associated taskPlatform: AllAn issue that impacts all the platformsPriority: LowStaleThere has been a lack of activity on this issue and it may be closed soon.Tech: React Native CoreIssue related to the Core of React NativeType: Old ArchitectureFor issues related to the old architecture🌐NetworkingRelated to a networking API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions