Skip to content

Conversation

@RobinPcrd
Copy link

Connection State Recovery Support

Implements Socket.IO v4.6.0 connection state recovery for the Java client.

What's New

Connection State Recovery

  • Client tracks session offset and PID across reconnections
  • Check recovery status with socket.isRecovered()
  • Get current offset with socket.getLastOffset()

Flexible Auth (Breaking Change)

  • Changed auth from Map<String, String> to JSONObject
  • Now supports complex auth payloads
// Before
opts.auth = Map.of("token", "abc123");

// After  
JSONObject auth = new JSONObject();
auth.put("token", "abc123");
opts.auth = auth;

Testing

  • All tests updated for Socket.IO v4.8.1
  • Added recovery scenario test
  • Fixed namespace event issues

Works with Socket.IO v4.6+ servers that have connection state recovery enabled.

- Implement Socket.IO v4 connection state recovery
  * Track PID and offset for session restoration
  * Add isRecovered() and getLastOffset() methods
  * Replay missed events after reconnect

- Change auth from Map to JSONObject for flexibility

- Upgrade test server from Socket.IO v3.0.4 to v4.8.1
  * Fix tests for v4 offset parameter
  * Fix namespace emission bugs

BREAKING CHANGE: auth is now JSONObject instead of Map<String,String>
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