Skip to content

refactor: type annotate content properly#4427

Merged
provinzkraut merged 2 commits intolitestar-org:mainfrom
winstxnhdw:refactor/server-sent-event-iterator
Oct 12, 2025
Merged

refactor: type annotate content properly#4427
provinzkraut merged 2 commits intolitestar-org:mainfrom
winstxnhdw:refactor/server-sent-event-iterator

Conversation

@winstxnhdw
Copy link
Copy Markdown
Contributor

@winstxnhdw winstxnhdw commented Oct 11, 2025

Description

This PR is a series of small changes to reduce noise for an eventual generator propagation fix.

Changes

  • If we are expecting content to be a Callable, we should type it as such.
  • Remove redundant Any as ServerSentEventMessage is typed str | int | bytes | None.
  • Reuse DEFAULT_HEADER in SSE header builder

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.83%. Comparing base (f39e7ba) to head (e074ad7).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4427   +/-   ##
=======================================
  Coverage   97.83%   97.83%           
=======================================
  Files         296      296           
  Lines       15286    15286           
  Branches     1711     1711           
=======================================
  Hits        14955    14955           
  Misses        189      189           
  Partials      142      142           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@winstxnhdw winstxnhdw marked this pull request as ready for review October 12, 2025 11:51
@winstxnhdw winstxnhdw requested review from a team as code owners October 12, 2025 11:51
@winstxnhdw winstxnhdw force-pushed the refactor/server-sent-event-iterator branch from 4f78e31 to e074ad7 Compare October 12, 2025 14:26
@github-actions
Copy link
Copy Markdown

Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/4427

@provinzkraut provinzkraut merged commit 08e8dad into litestar-org:main Oct 12, 2025
28 checks passed
provinzkraut pushed a commit that referenced this pull request Dec 13, 2025
* refactor: type annotate `content` properly

* refactor: reuse `DEFAULT_SEPARATOR`

(cherry picked from commit 08e8dad)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants