• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / supabase-swift / 35221295927
89%

Build:
DEFAULT BRANCH: main
Ran 17 Sep 2026 12:32PM UTC
Jobs 1
Files 134
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

17 Sep 2026 12:28PM UTC coverage: 89.146% (+0.2%) from 88.939%
35221295927

push

github

web-flow
refactor(realtime): extract the transport error to close-frame mapping (#1360)

* refactor(realtime): extract the transport error to close-frame mapping

`_closeConnectionWithError` scored CRAP 35.8 — CC 8 at 24.2% coverage —
and almost all of that complexity was already a pure decision: map an
NSError's domain and code onto the RFC 6455 close code and reason. It
just happened to be spelled as an immediately-invoked closure inside a
method that also cancels the task and emits the close event, so nothing
could reach it without a live socket.

`closeFrame(for:)` lifts it out as a static, next to `validatedCloseCode`
and for the same stated reason: it makes the whole mapping testable from
a plain NSError, no socket or network involved. Returning nil now carries
the "leave this connection alone" case, so the ENOTCONN early return is
part of the mapping under test rather than control flow wrapped around
it.

The new tests pin the table, including two edges the old shape made easy
to break: 57 outside NSPOSIXErrorDomain is an ordinary error and must
still close, and the three named URLError cases report written reasons
rather than localizedDescription so the peer sees the same text on every
locale. A native Swift error is covered too, since the receive loop
passes whatever receive() threw and `_handleMessage` passes a
RealtimeError of its own.

_closeConnectionWithError drops to CC 2 (CRAP 2.9) and closeFrame lands
at CC 7, 100% covered.

Fixes SDK-1871

Co-authored-by: Claude <noreply@anthropic.com>

* chore: add ENOTCONN to the spell-check dictionary

`closeFrame(for:)` names the POSIX errno it special-cases rather than
leaving a bare 57 in the doc comment, and cspell doesn't know errno
constants. Legitimate technical term, so it goes in dictionary.txt per
AGENTS.md.

Co-authored-by: Claude <noreply@anthropic.com>

* fix(realtime): match POSIX errno by name, not Darwin's numbers

closeFrame(for:) matched errno values as literals carried over from the
orig... (continued)

27 of 27 new or added lines in 1 file covered. (100.0%)

10628 of 11922 relevant lines covered (89.15%)

54.31 hits per line

Jobs
ID Job ID Ran Files Coverage
1 35221295927.1 17 Sep 2026 12:32PM UTC 134
89.15
GitHub Action Run
Source Files on build 35221295927
  • Tree
  • List 134
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #35221295927
  • d0d08638 on github
  • Prev Build on main (#35210399762)
  • Next Build on main (#35222124927)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc