Log a contract response an ASGI caller never received as not sent

Open
#131 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
django, python
Domain
backend

Research direction

Start with ADR 0011, especially Consequences and Decision 5, then read the provider-side coroutine and the request handling in tests/test_request_root.py. Add an ASGI client case that disconnects during the action and check that the single neolith.calls line records that the caller went away instead of the unsent status.

Written by the indexing model from the issue text.

Description

help wanted

Found in the red-team pass of #129 (provider endpoints).

  • Under ASGI, a caller that disconnects while its action runs cancels the request's task, and the action runs on in its thread (ADR 0011, Consequences). The endpoint still writes its one neolith.calls line with the status it built, such as 200 reply, though Django never sends that response.
  • ADR 0011 Decision 5 fixes one line per contract response and says nothing of a response that is never sent, so the record is not contradicted; the line is only misleading for that case.
  • Candidate fix: the coroutine that awaits the provider side notes the cancellation, and the line says the caller went away instead of giving the status. Test with an ASGI client that disconnects mid-action, as tests/test_request_root.py does.
Dominant language
Python
Stars
1
Forks
0
Avg merge
5h 30m
Merged PRs (30d)
85

Getting set up

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.

More from stack314/django-neolith

All issues in stack314/django-neolith

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.