softwaremill / softwaremill/tapir

Cannot cancel a stream

Open
#2,593 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
1.5k
Forks
468
Avg merge
5h 37m
Merged PRs (30d)
34

Description

Tapir version:
1.2.2

Describe the bug

When using a bodyStream endpoint, a download properly start when calling the endpoints, but if I cancel the download, the stream continue in background (in my case calling fetching data in DB).

Not sure how to fix this, do we already have a way to get notified if an http request get aborted? we could plug some kind of a callback to cancel the stream in such case.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with a bodyStream endpoint and cancelling the download while the backing database work is active. Read the bodyStream streaming and HTTP server integration entry points to determine whether request-abort notification is exposed. Done means cancellation stops the background stream or database work, with regression coverage for an aborted request.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.