Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughReordered connection state processing so the state handler is enacted before notifying connection listeners; transport cleanup now occurs after enactment/notification. Added a RTL3d1 test asserting channel is Changes
Sequence Diagram(s)sequenceDiagram
participant CM as ConnectionManager
participant SH as StateHandler
participant CL as ConnectionListener
participant T as Transport
CM->>SH: enact(stateIndication, change)
SH-->>CM: enact complete
alt state changed (current != previous)
CM->>CL: onConnectionStateChange(change)
CL-->>CM: listener callbacks (may call attach())
end
alt currentState.terminal
CM->>T: clearTransport()
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@lib/src/main/java/io/ably/lib/transport/ConnectionManager.java`:
- Around line 606-608: The code dispatches state transition work using the
originally requested state (stateIndication.state) instead of the
validated/actual state returned by setState(), causing handlers (states.enact)
to run for an incorrect state; change the call to use the validated current
state (e.g., use change.current or the state from setState() result) when
invoking states.get(...).enact(...), so replace
states.get(stateIndication.state).enact(stateIndication, change) with a call
that uses the validated state identifier (such as
states.get(change.current).enact(stateIndication, change)) to ensure channel
handlers receive the actual transition.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 177b8abb-69b4-4f95-8bb8-9ea97f032d3b
📒 Files selected for processing (2)
lib/src/main/java/io/ably/lib/transport/ConnectionManager.javalib/src/test/java/io/ably/lib/test/realtime/RealtimeChannelTest.java
09be0f1 to
2758570
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@lib/src/test/java/io/ably/lib/test/realtime/RealtimeChannelTest.java`:
- Around line 2656-2704: The test method
channel_state_is_attaching_on_reconnected creates an AblyRealtime instance
(variable ably) but never closes it; wrap the test body that uses ably in a
try-finally and ensure ably.close() (or the appropriate shutdown method on
AblyRealtime) is called in the finally block so the client and its threads are
always cleaned up even if assertions fail or exceptions are thrown.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: becf14d3-2d3d-4a86-a750-5e330f831314
📒 Files selected for processing (2)
lib/src/main/java/io/ably/lib/transport/ConnectionManager.javalib/src/test/java/io/ably/lib/test/realtime/RealtimeChannelTest.java
…listeners notify (RTL3d1) - Adjusted `enactState` to update channel states prior to notifying connection state listeners. - Added a test to validate channel state transitions during reconnection.
2758570 to
056fc55
Compare
SimonWoolf
left a comment
There was a problem hiding this comment.
not familiar with ably-java but looks plausible
Resolves #1201
enactStateto update channel states prior to notifying connection state listeners.Summary by CodeRabbit
Bug Fixes
Tests