Skip to content
Open
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
3343424
Handle EIO v2/3/4 binary framing; add integration tests
sanjomo Jul 30, 2026
dc28d25
Add lossless JSON byte[] support and tests
sanjomo Jul 30, 2026
cc5676c
Update build.yml
sanjomo Jul 30, 2026
d80f334
Improve EIO polling, base64, JSON and listeners
sanjomo Jul 30, 2026
729c2ff
Fix Engine.IO v4 polling encoding and tests
sanjomo Jul 30, 2026
3f44e6e
Handle PONG/ERROR parsing and add cross-version tests
sanjomo Jul 31, 2026
2180995
Handle Redisson shutdown; add robustness tests
sanjomo Jul 31, 2026
3f20fbf
Update pom.xml
sanjomo Jul 31, 2026
509f041
Fix polling attachment branching and remove unused import
sanjomo Jul 31, 2026
750cbc8
Fix buffer handling & add license headers
sanjomo Jul 31, 2026
73254cb
fix: apply CodeRabbit auto-fixes
coderabbitai[bot] Jul 31, 2026
c927d35
Fix SSL server restart test flakiness
sanjomo Jul 31, 2026
57d87c0
Handle byte[] JSON and fix
sanjomo Aug 1, 2026
0a18669
Shutdown test stores and improve leak detection
sanjomo Aug 1, 2026
cf9e014
Update EventMessageJsonSupport.java
sanjomo Aug 1, 2026
1d13117
Improve shutdown detection and fix flaky tests
sanjomo Aug 1, 2026
e2df931
Remove EngineIOVersion from Packet; refactor encoder API
sanjomo Aug 2, 2026
367cc81
Refactor packet encoding, add license headers
sanjomo Aug 2, 2026
075b21d
Avoid Objects.requireNonNullElse for attachments
sanjomo Aug 2, 2026
82827f2
Update pom.xml
sanjomo Aug 2, 2026
06e0112
Refactor binary packet handling and tests
sanjomo Aug 3, 2026
1e8d121
Add JS interop tests; refine packet handling & disconnect
sanjomo Aug 3, 2026
3c44f53
Improve exception logging for expected disconnects
sanjomo Aug 3, 2026
dec2617
Normalize error message handling in tests
sanjomo Aug 3, 2026
0d725a6
Ensure namespace cleanup on failed disconnect send
sanjomo Aug 3, 2026
cd37012
Handle null packets and add transport upgrade tests
sanjomo Aug 4, 2026
f56ae8c
Update test-clients-transport.js
sanjomo Aug 4, 2026
737c95d
Add socket.io-client v4/minimist; improve tests
sanjomo Aug 4, 2026
9c33a8e
Improve error logging and add JS batch interop test
sanjomo Aug 4, 2026
50526a1
Refactor PacketEncoder encoding logic
sanjomo Aug 4, 2026
a975dca
Add browser JS interop tests and protocol fixes
sanjomo Aug 5, 2026
f52c076
Enhance JS interop tests with client verification
sanjomo Aug 5, 2026
b967a1d
Update build.yml
sanjomo Aug 5, 2026
f996bfb
Update build.yml
sanjomo Aug 5, 2026
a5769cb
Use dynamic ports in browser interop tests
sanjomo Aug 5, 2026
c88f407
Support Java 11 module-info via multi-release JAR
sanjomo Aug 6, 2026
37c2ed4
Update build.yml
sanjomo Aug 6, 2026
e0377bb
Add global Netty leak detector & expand tests, update CI
sanjomo Aug 6, 2026
7b08103
Improve test parallelism and stability
sanjomo Aug 6, 2026
b3a5e3a
Update build-pr.yml
sanjomo Aug 6, 2026
53aafc7
Update junit-platform.properties
sanjomo Aug 6, 2026
728ffa6
Fix ByteBuf leak and improve test stability
sanjomo Aug 6, 2026
a00a764
Add Kafka/NATS cluster tests; refactor test helpers
sanjomo Aug 6, 2026
237a454
Add Hazelcast distributed tests; refactor test support
sanjomo Aug 6, 2026
60920fc
Update DistributedHazelcastClusterTest.java
sanjomo Aug 6, 2026
80dbe5d
Reduce test parallelism
sanjomo Aug 6, 2026
c5e85d4
Remove debug print statements from tests
sanjomo Aug 6, 2026
cbe40c0
Remove unused import and jmockit coverage property
sanjomo Aug 6, 2026
c54357b
Update BrowserInteropTest.java
sanjomo Aug 6, 2026
6de233e
Update BrowserInteropTest.java
sanjomo Aug 6, 2026
d86b351
Defer polling disconnect; numeric byte[] support
sanjomo Aug 7, 2026
578c5a7
Refine logging and Kafka wakeup handling
sanjomo Aug 7, 2026
83ccc26
Default Engine.IO version to V4 and update tests
sanjomo Aug 7, 2026
5c720a6
Add integration tests for stability and resilience
sanjomo Aug 7, 2026
2005e58
Reorganize tests, add JUnit test suites
sanjomo Aug 7, 2026
91ab739
Improve test stability and CI config
sanjomo Aug 7, 2026
c08af9b
Update DistributedRedissonClusterTest.java
sanjomo Aug 8, 2026
d5374e5
Protocol compliance optimisations & JS interop matrix
sanjomo Aug 8, 2026
b18847a
test improvement & protocol compliance
sanjomo Aug 8, 2026
d249668
Update AuthorizeHandlerTest.java
sanjomo Aug 8, 2026
a7954b7
Add reusable interop tests and interop matrix
sanjomo Aug 8, 2026
3f0e6e2
Refactor tests and improve server start handling
sanjomo Aug 9, 2026
c171dad
Update AbstractDistributedJsClientInteropTest.java
sanjomo Aug 9, 2026
96eac8e
Improve distributed client confirmation tracking
sanjomo Aug 9, 2026
8ab38fb
Delay head removal until transport closes
sanjomo Aug 10, 2026
b0668c6
Update pom.xml
sanjomo Aug 14, 2026
cffd7f4
Update pom.xml
sanjomo Aug 14, 2026
e21c7df
Engine.IO v4 support and poll-timeout refactor
sanjomo Aug 18, 2026
e558037
Fix transport races and v4 CONNECT enforcement
sanjomo Aug 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Auto-detect text files and normalize line endings
* text=auto

# Declare explicit line endings for java files
*.java text eol=lf
*.xml text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.md text eol=lf
12 changes: 4 additions & 8 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,10 @@ jobs:
build:
strategy:
matrix:
include:
- java-version: 17
delay: 0
- java-version: 21
delay: 0
- java-version: 25
delay: 0
os: [ubuntu-latest]
java-version: [17, 21, 25]
uses: ./.github/workflows/build.yml
with:
os: "${{ matrix.os }}"
javaVersion: "${{ matrix.java-version }}"
delay: "${{ matrix.delay }}"
interopVersions: "smoke"
74 changes: 56 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,22 @@ on:
javaVersion:
required: true
type: string
os:
required: false
type: string
default: "ubuntu-latest"
delay:
required: false
type: string
default: "0"
interopVersions:
required: false
type: string
default: "smoke"

jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ inputs.os }}

env:
# Allow Testcontainers to control Docker
Expand All @@ -26,39 +34,69 @@ jobs:
steps:
# --- Staggered delay ---
- name: Stagger job start
run: sleep ${{ inputs.delay }}
env:
DELAY: ${{ inputs.delay }}
run: sleep "$DELAY"

# --- Checkout ---
- name: Checkout
uses: actions/checkout@v4

# --- Enable Docker (already preinstalled on runners) ---
- name: Start Docker daemon
run: |
sudo systemctl start docker
sudo systemctl status docker --no-pager

# --- Validate Docker works ---
- name: Docker Info
run: docker info
uses: actions/checkout@v7

# --- Java / Maven Setup ---
- name: Set up Java
uses: actions/setup-java@v3
uses: actions/setup-java@v5
with:
java-version: ${{ inputs.javaVersion }}
distribution: temurin
cache: maven

# --- Node.js 22 Setup with Package Caching ---
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: 22
cache: 'npm'
cache-dependency-path: 'netty-socketio-core/src/test/resources/js-interop/package-lock.json'

# --- Install JS Client Interop Dependencies ---
- name: Install JS Interop Dependencies
working-directory: netty-socketio-core/src/test/resources/js-interop
run: npm ci

# --- Cache Playwright Browsers ---
- name: Cache Playwright Browsers
id: playwright-cache
uses: actions/cache@v6
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('netty-socketio-core/src/test/resources/js-interop/package-lock.json', 'netty-socketio-core/src/test/resources/js-interop/package.json') }}
restore-keys: |
${{ runner.os }}-playwright-

# --- Install Playwright Browsers & OS Deps (On Cache Miss) ---
- name: Install Playwright Browsers & OS Deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
working-directory: netty-socketio-core/src/test/resources/js-interop
run: npx playwright install --with-deps chromium firefox webkit

# --- Install OS Deps Only (On Cache Hit) ---
- name: Install Playwright OS Dependencies
if: steps.playwright-cache.outputs.cache-hit == 'true'
working-directory: netty-socketio-core/src/test/resources/js-interop
run: npx playwright install-deps chromium firefox webkit

# --- Testcontainers configuration for CI ---
- name: Disable Testcontainers reuse
run: |
echo "testcontainers.reuse.enable=false" > ~/.testcontainers.properties
cat ~/.testcontainers.properties

# --- Build + Tests ---
- name: Build Project
timeout-minutes: 90
timeout-minutes: 120
run: |
export MAVEN_OPTS="-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN"
mvn --batch-mode --errors --fail-at-end -DforkCount=1 verify
export MAVEN_OPTS="-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN \
-Dorg.slf4j.simpleLogger.defaultLogLevel=WARN \
-Dcom.socketio4j.socketio.level=WARN \
-Dio.netty.leakDetection.level=PARANOID"
mvn --batch-mode --errors --fail-at-end -Dsocketio.test.forkCount=1C \
-Dsocketio.interop.versions=${{ inputs.interopVersions }} verify
15 changes: 11 additions & 4 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,22 @@
types: [created]
workflow_dispatch:
jobs:
build:
verify-release:
uses: ./.github/workflows/build.yml
with:
javaVersion: "21"
interopVersions: "full"

publish:
Comment on lines +8 to +13
needs: verify-release
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Set up JDK 21
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
Expand All @@ -27,5 +34,5 @@
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
# for publish, skip test, because test is in CI
# Interop and project verification run in verify-release above.
run: mvn --batch-mode -DskipTests -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} clean deploy -P release
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
**/.vscode
**/.idea
**/*.iml
**/dependency-reduced-pom.xml
**/dependency-reduced-pom.xml
**/node_modules/
4 changes: 3 additions & 1 deletion checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@
<module name="NestedIfDepth">
<property name="max" value="3"/>
</module>
<module name="NestedTryDepth"/>
<module name="NestedTryDepth">
<property name="max" value="2"/>
</module>
<module name="NoClone"/>
<module name="NoFinalizer"/>
<module name="OneStatementPerLine"/>
Expand Down
111 changes: 106 additions & 5 deletions netty-socketio-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,6 @@
<artifactId>testcontainers-kafka</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jmockit</groupId>
<artifactId>jmockit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
Expand All @@ -177,6 +172,16 @@
<artifactId>junit-platform-launcher</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
Expand Down Expand Up @@ -207,6 +212,12 @@
<artifactId>socket.io-client</artifactId>
<scope>test</scope>
</dependency>
<!-- OkHttp for raw HTTP/WS integration tests (EIOv3, SSL, etc.) -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.javafaker</groupId>
<artifactId>javafaker</artifactId>
Expand Down Expand Up @@ -242,4 +253,94 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- Suites are manual aggregation entry points. Running them during
normal discovery duplicates the classes they select. -->
<excludes>
<exclude>**/*Suite.java</exclude>
<!-- These four classes run together in the execution below so
they can share one rigorously-reset single-node fixture. -->
<exclude>**/JsClientInteropTest.java</exclude>
<exclude>**/JsMultiClientInteropTest.java</exclude>
<exclude>**/JsNamespaceInteropTest.java</exclude>
<exclude>**/JsTransportInteropTest.java</exclude>
<!-- The common single-node protocol profile runs in the same
isolated fixture execution as the compatible JS clients. -->
<exclude>**/integration/protocol/*Test.java</exclude>
<exclude>**/AbruptDisconnectBinaryUploadIntegrationTest.java</exclude>
<!-- Container-backed and distributed tests consume Docker and
shared local compute resources. JUnit resource locks do not
cross Surefire JVMs, so run these through the isolated
execution below rather than the 1C worker pool. -->
<exclude>**/integration/cluster/**/*Test.java</exclude>
<exclude>**/integration/interop/Distributed*InteropTest.java</exclude>
<exclude>**/store/HazelcastStoreFactoryTest.java</exclude>
<exclude>**/store/HazelcastStoreTest.java</exclude>
<exclude>**/store/RedissonReliableStoreFactoryTest.java</exclude>
<exclude>**/store/RedissonStoreTest.java</exclude>
<exclude>**/store/event/HazelcastRingBufferEventStoreTest.java</exclude>
<exclude>**/store/event/RedisPubSubEventStoreTest.java</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>external-service-integration</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<!-- A dedicated serial worker prevents Docker resource
contention while retaining a complete Surefire report for
nested test classes. Each top-level test class owns and
stops its container in its class lifecycle; its backend
state therefore cannot flow into the next class. -->
<forkCount>1</forkCount>
<reuseForks>true</reuseForks>
<includes combine.self="override">
<include>**/integration/cluster/**/*Test.java</include>
<include>**/integration/interop/Distributed*InteropTest.java</include>
<include>**/store/HazelcastStoreFactoryTest.java</include>
<include>**/store/HazelcastStoreTest.java</include>
<include>**/store/RedissonReliableStoreFactoryTest.java</include>
<include>**/store/RedissonStoreTest.java</include>
<include>**/store/event/HazelcastRingBufferEventStoreTest.java</include>
<include>**/store/event/RedisPubSubEventStoreTest.java</include>
</includes>
<excludes combine.self="override" />
</configuration>
</execution>
<execution>
<id>shared-single-node-js-interop</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<!-- This worker deliberately remains single-process. The
ordinary execution stays parallel through
socketio.test.forkCount. -->
<forkCount>1</forkCount>
<reuseForks>true</reuseForks>
<includes combine.self="override">
<include>**/JsClientInteropTest.java</include>
<include>**/JsMultiClientInteropTest.java</include>
<include>**/JsNamespaceInteropTest.java</include>
<include>**/JsTransportInteropTest.java</include>
<include>**/integration/protocol/*Test.java</include>
<include>**/AbruptDisconnectBinaryUploadIntegrationTest.java</include>
</includes>
<excludes combine.self="override" />
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void sendAckData(List<Object> objs) {
if (!isAckRequested() || !sent.compareAndSet(false, true)) {
return;
}
Packet ackPacket = new Packet(PacketType.MESSAGE, client.getEngineIOVersion());
Packet ackPacket = new Packet(PacketType.MESSAGE);
ackPacket.setSubType(PacketType.ACK);
ackPacket.setAckId(originalPacket.getAckId());
ackPacket.setData(objs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
import java.util.Objects;
import java.util.function.Predicate;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.socketio4j.socketio.misc.IterableCollection;
import com.socketio4j.socketio.protocol.EngineIOVersion;
import com.socketio4j.socketio.protocol.Packet;
import com.socketio4j.socketio.protocol.PacketType;
import com.socketio4j.socketio.store.StoreFactory;
Expand All @@ -34,6 +36,7 @@
* Date: 2020/8/8 6:08 PM
*/
public class SingleRoomBroadcastOperations implements BroadcastOperations {
private static final Logger log = LoggerFactory.getLogger(SingleRoomBroadcastOperations.class);
private final String namespace;
private final String room;
private final Iterable<SocketIOClient> clients;
Expand Down Expand Up @@ -61,7 +64,6 @@ public Collection<SocketIOClient> getClients() {
@Override
public void send(Packet packet) {
for (SocketIOClient client : clients) {
packet.setEngineIOVersion(client.getEngineIOVersion());
client.send(packet);
}
dispatch(packet);
Expand Down Expand Up @@ -92,13 +94,12 @@ public void sendEvent(String name, SocketIOClient excludedClient, Object... data

@Override
public void sendEvent(String name, Predicate<SocketIOClient> excludePredicate, Object... data) {
Packet packet = new Packet(PacketType.MESSAGE, EngineIOVersion.UNKNOWN);
Packet packet = new Packet(PacketType.MESSAGE);
packet.setSubType(PacketType.EVENT);
packet.setName(name);
packet.setData(Arrays.asList(data));

for (SocketIOClient client : clients) {
packet.setEngineIOVersion(client.getEngineIOVersion());
if (excludePredicate.test(client)) {
continue;
}
Expand All @@ -109,7 +110,7 @@ public void sendEvent(String name, Predicate<SocketIOClient> excludePredicate, O

@Override
public void sendEvent(String name, Object... data) {
Packet packet = new Packet(PacketType.MESSAGE, EngineIOVersion.UNKNOWN);
Packet packet = new Packet(PacketType.MESSAGE);
packet.setSubType(PacketType.EVENT);
packet.setName(name);
packet.setData(Arrays.asList(data));
Expand Down
Loading
Loading