Skip to content

Remove data packet size check in raw data packets#948

Open
1egoman wants to merge 3 commits into
mainfrom
remove-data-packet-size-check
Open

Remove data packet size check in raw data packets#948
1egoman wants to merge 3 commits into
mainfrom
remove-data-packet-size-check

Conversation

@1egoman
Copy link
Copy Markdown

@1egoman 1egoman commented May 22, 2026

Most other client sdks (I referenced client-sdk-js, rust-sdks, and client-sdk-swift) allow a user to send a raw data packet via localParticipant.publishData which can be as long the user wants.

client-sdk-android on the other hand looks to be special, and if you send longer than 15kb, it will bail early and throw an error:

if (data.size > RTCEngine.MAX_DATA_PACKET_SIZE) {
    return Result.failure(IllegalArgumentException("cannot publish data larger than " + RTCEngine.MAX_DATA_PACKET_SIZE))
}

My initial thinking is that it might make sense to remove this check on android because none of the other sdks do it this way, and this is a low level api where the assumption would be that a user knows what they are doing / would understand the potential implications of sending a very long data packet. It wouldn't be a breaking change because removing the check is "widening" the api interface / all existing callers would still work.

I've tested this locally by sending data packets larger than 15kb to the android example app and it is able to receive it properly. If there's any more extensive testing that needs to be done here, please let me know.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 22, 2026

🦋 Changeset detected

Latest commit: 3e4695f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
client-sdk-android Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 22, 2026

Diffuse output:

OLD: diffuse-source-file
NEW: livekit-android-sdk-release.aar

 AAR      │ old      │ new      │ diff  
──────────┼──────────┼──────────┼───────
      jar │    4 MiB │    4 MiB │ -74 B 
 manifest │  1.5 KiB │  1.5 KiB │   0 B 
 lint-jar │ 12.7 KiB │ 12.7 KiB │   0 B 
    other │  1.8 KiB │  1.8 KiB │   0 B 
──────────┼──────────┼──────────┼───────
    total │    4 MiB │    4 MiB │ -74 B 

 JAR     │ old   │ new   │ diff      
─────────┼───────┼───────┼───────────
 classes │  2215 │  2215 │ 0 (+0 -0) 
 methods │ 42995 │ 42995 │ 0 (+0 -0) 
  fields │  8403 │  8403 │ 0 (+0 -0)
AAR
 size  │ diff  │ path          
───────┼───────┼───────────────
 4 MiB │ -74 B │ ∆ classes.jar 
───────┼───────┼───────────────
 4 MiB │ -74 B │ (total)

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.

1 participant