Skip to content

feat: add Swift SSE client - #69

Merged
sbharatjoshi merged 2 commits into
spectrayan:mainfrom
timothytkim:feat/59-ios-sse
Oct 5, 2026
Merged

sbharatjoshi merged 2 commits into
spectrayan:mainfrom
timothytkim:feat/59-ios-sse

Conversation

@timothytkim

Copy link
Copy Markdown
Contributor

Summary

Explain the motivation and context. Link related issues.

Changes

  • Feature / Enhancement
  • Bug fix
  • Documentation
  • Build / CI

How to test

Steps or commands to verify the change locally:

make ci

Add any specific app commands, URLs, or screenshots.

Checklist

  • I ran make ci locally and it passed
  • I added/updated tests where practical
  • I updated documentation (README, comments) where needed
  • I agree to the Code of Conduct

Screenshots / Logs (optional)

Breaking changes (if any)

Describe impact and migration path.

Additional context

If discussing privately is needed, contact support@spectrayan.com

@timothytkim
timothytkim requested review from a team and sbharatjoshi as code owners October 3, 2026 21:41
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown

Thank you for your contribution! Before we can review this PR, we need you to sign our Contributor License Agreement (CLA).

To sign, please comment on this PR with:

I have read the CLA Document and I hereby sign the CLA

The CLA protects both you and the project. You can read the full CLA here.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@forgespectrayan

Copy link
Copy Markdown
Contributor

Hi @timothytkim, thanks for opening this PR and working on the Swift SSE client for #59!

I took a look through the implementation. The architectural approach is really clean — especially the W3C streaming byte parser in SSEParser.swift (handling arbitrary chunk boundaries, BOM stripping, :keepalive comment filtering) and the Swift 6 strict concurrency design using AsyncThrowingStream and Sendable.

Here is some feedback on the current status and a few items needed before we can get this merged:


1. CLA Check Status 📝

The CLA check is failing because our CLA Assistant bot requires contributors to sign the Contributor License Agreement before PRs can be merged.

To sign and turn the check green, simply reply to this PR with the exact phrase:

I have read the CLA Document and I hereby sign the CLA

Once posted, the bot will record your signature in cla-signatures.json and mark the check as passed.


2. Local Build & Compilation Issues 🔨

Because our CI doesn't have a Swift workflow yet (we'll be adding one!), the other CI checks passed, but compiling locally via swift test surfaces a few missing definitions:

  1. Missing SSEClientError definition:
    SSESessionDelegate.swift and the test files reference SSEClientError.unexpectedStatusCode(...), SSEClientError.invalidContentType(...), and SSEClientError.nonHTTPResponse, but SSEClientError isn't defined in the target. It looks like the file containing enum SSEClientError might have been missed in git add.

  2. cannot find 'SpectrayanSSEClient' in scope:
    In SSEClient.swift:128, there is a call to SpectrayanSSEClient.isRetryable(error), but the class declared in that file is SSEClient, and SpectrayanSSEClient is not defined.

  3. Reconciling Client & Test Suite Naming:
    There are currently two client test suites:

    • SSEClientTests.swift (tests SSEClient)
    • SpectrayanSSEClientTests.swift (tests SpectrayanSSEClient and SSEClientConfiguration)

    Could you reconcile whether the public client class is intended to be SSEClient or SpectrayanSSEClient (matching SpectrayanSseClient in Kotlin and Go), ensure its configuration type is committed, and clean up any redundant test files?


3. Documentation & PR Hygiene 📚

  • PR Description: Could you update the PR description to summarize the changes and link the issue with Closes #59?
  • README: Please consider adding a brief clients/swift/README.md showing SPM integration (Package.swift) and a quickstart example using for try await event in client.events(). You can refer to clients/kotlin/README.md or clients/go/README.md as reference templates.

Thanks again for your contribution! Looking forward to having Swift support in the ecosystem. Let us know if you need any guidance or have questions on any of the above. 🚀

— Forge (Maintainer)

- Add SSEClientError
- Move retry classification to SSEClient.isRetryable
- Consolidate client tests into SSEClientTests and remove stale SpectrayanSSEClientTests
- Add Swift client README
- Ignore .swiftpm/
@timothytkim

Copy link
Copy Markdown
Contributor Author

Just updated @forgespectrayan

@sbharatjoshi
sbharatjoshi merged commit 326ae26 into spectrayan:main Oct 5, 2026
7 of 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.

3 participants