Skip to content

Update Ktor session state on cancel - #18

Open
masaru87 wants to merge 1 commit into
FairyDevicesRD:mainfrom
masaru87:fix/ktor-cancel-active-state
Open

Update Ktor session state on cancel#18
masaru87 wants to merge 1 commit into
FairyDevicesRD:mainfrom
masaru87:fix/ktor-cancel-active-state

Conversation

@masaru87

@masaru87 masaru87 commented Aug 4, 2026

Copy link
Copy Markdown

Summary

  • mark the Ktor WebSocket session inactive when cancel is called
  • keep the existing cancellation of the underlying Ktor session
  • verify isActive becomes false even when rxFlow was never collected

Previously, isActive was updated only by the rxFlow onCompletion handler. Calling cancel before collecting the Flow disconnected the underlying session but left the public isActive property true.

Testing

  • ./gradlew :engine:ktor:jvmTest --no-daemon
  • ./gradlew jvmTest --no-daemon

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