Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate SRStatusNoStatusReceived and update naming for consistency #695

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nnabeyang
Copy link
Contributor

This PR introduces a renaming of SRStatusNoStatusReceived to SRStatusCodeNoStatusReceived for better consistency with the existing naming conventions. The old constant is now marked as deprecated with a message guiding developers to use the new SRStatusCodeNoStatusReceived instead.

Additionally, the updated naming makes it easier to write clean and understandable code in Swift, as shown in this example:

func testSRStatusCode() throws {
    XCTAssertEqual(SRStatusCode.normal.rawValue, 1000)
    XCTAssertEqual(SRStatusCode.goingAway.rawValue, 1001)
    XCTAssertEqual(SRStatusCode.protocolError.rawValue, 1002)
    XCTAssertEqual(SRStatusCode.unhandledType.rawValue, 1003)
    XCTAssertEqual(SRStatusCode.noStatusReceived.rawValue, 1005)
    XCTAssertEqual(SRStatusCode.abnormal.rawValue, 1006)
    XCTAssertEqual(SRStatusCode.invalidUTF8.rawValue, 1007)
    XCTAssertEqual(SRStatusCode.policyViolated.rawValue, 1008)
    XCTAssertEqual(SRStatusCode.messageTooBig.rawValue, 1009)
    XCTAssertEqual(SRStatusCode.missingExtension.rawValue, 1010)
    XCTAssertEqual(SRStatusCode.internalError.rawValue, 1011)
    XCTAssertEqual(SRStatusCode.serviceRestart.rawValue, 1012)
    XCTAssertEqual(SRStatusCode.tryAgainLater.rawValue, 1013)
    XCTAssertEqual(SRStatusCode.tlsHandshake.rawValue, 1015)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants