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

sgerrand / ex_teya / 36345917173
100%

Build:
DEFAULT BRANCH: main
Ran 27 Sep 2026 07:52PM UTC
Jobs 1
Files 24
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

27 Sep 2026 07:52PM UTC coverage: 100.0%. Remained the same
36345917173

push

github

web-flow
feat(poslink)!: carry the subscription's ref in every stream message (#54)

* feat(poslink)!: carry the subscription's ref in every stream message

Stream messages carried only the payment or receipt id, so two streams
for the same id, such as a second subscribe after a drop, mixed their
events and errors together with no way to tell them apart. Every
message now carries the ref of the %Task{} the subscribe function
returns:

    {:poslink_payment, ref, id, event_type, data}
    {:poslink_payment_error, ref, id, %Teya.Error{}}
    {:poslink_receipt, ref, id, event_type, data}
    {:poslink_receipt_error, ref, id, %Teya.Error{}}

A task cannot see its own ref, which belongs to the caller's monitor, so
the new Teya.SSE.subscribe/6, which both subscribe functions now use,
sends it to the task once started. The task waits for it before opening
the stream, and ends after 5 seconds if it never comes, which only
happens if the caller died in between.

BREAKING CHANGE: POSLink stream messages gain the subscription's ref as
their second element. Match {:poslink_payment, ^ref, id, type, data} and
{:poslink_payment_error, ^ref, id, reason}, and the same for receipts,
where ref is the ref of the task subscribe/3 or subscribe_status/3
returns.

* fix(sse): keep streaming when the caller dies before sending the ref

A subscribe task waited for its ref and, if the caller died after
starting it but before sending the ref, timed out without opening the
stream. A separate recipient then heard nothing, where before refs were
added the unlinked task carried on streaming for it. The task now
monitors the caller while it waits: if the caller dies first, or the ref
never comes, it streams anyway with nil as the ref. Nobody can hold the
ref then, since subscribe never returned it, and a recipient matching
any ref still hears the stream.

Teya.SSE's module docs now describe subscribe/6 and the ref-bearing
messages instead of the private stream/6.

* fix(sse): return :ok from ... (continued)

21 of 21 new or added lines in 3 files covered. (100.0%)

455 of 455 relevant lines covered (100.0%)

46.5 hits per line

Jobs
ID Job ID Ran Files Coverage
1 36345917173.1 27 Sep 2026 07:52PM UTC 24
100.0
GitHub Action Run
Source Files on build 36345917173
  • Tree
  • List 24
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #36345917173
  • 7346f28f on github
  • Prev Build on main (#36341592680)
  • Next Build on main (#36347066457)
  • Delete
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