Skip to content

Comments

Add Close Frame Record return type support#1497

Merged
MohamedSabthar merged 62 commits intoballerina-platform:mainfrom
chathushkaayash:main
Apr 1, 2025
Merged

Add Close Frame Record return type support#1497
MohamedSabthar merged 62 commits intoballerina-platform:mainfrom
chathushkaayash:main

Conversation

@chathushkaayash
Copy link
Contributor

@chathushkaayash chathushkaayash commented Feb 11, 2025

Purpose

$subject

Resolves Add support for websocket close frame

Examples

1. Close the connection using NormalClosure

remote function onMessage(websocket:Caller caller, string data) returns websocket:NormalClosure {
    // ... omitted for brevity
    return websocket:NORMAL_CLOSURE;
}

2. Close the connection using CustomCloseFrame

remote function onMessage(websocket:Caller caller, string data) returns websocket:CustomCloseFrame {
    // ... omitted for brevity
    return {status: 3555, reason: "Custom close frame message"};
}

Checklist

  • Linked to an issue
  • Updated the specification
  • Updated the changelog
  • Added tests
  • Checked native-image compatibility

@ayeshLK ayeshLK marked this pull request as ready for review February 19, 2025 04:52
@ayeshLK ayeshLK requested review from Bhashinee and removed request for ThisaruGuruge and shafreenAnfar February 19, 2025 04:52
@codecov
Copy link

codecov bot commented Mar 24, 2025

Codecov Report

Attention: Patch coverage is 83.01887% with 9 lines in your changes missing coverage. Please review.

Project coverage is 82.37%. Comparing base (2d73a97) to head (43701ea).
Report is 64 commits behind head on main.

Files with missing lines Patch % Lines
...na/stdlib/websocket/WebSocketResourceCallback.java 78.94% 4 Missing and 4 partials ⚠️
...a/io/ballerina/stdlib/websocket/WebSocketUtil.java 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1497      +/-   ##
============================================
+ Coverage     82.32%   82.37%   +0.04%     
- Complexity      575      591      +16     
============================================
  Files            48       48              
  Lines          3015     3063      +48     
  Branches        393      404      +11     
============================================
+ Hits           2482     2523      +41     
- Misses          393      397       +4     
- Partials        140      143       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@ayeshLK ayeshLK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 1, 2025

@MohamedSabthar MohamedSabthar merged commit 51e29b3 into ballerina-platform:main Apr 1, 2025
8 checks passed
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.

Add support for websocket close frame

6 participants