aio-libs / aiohttp-sse

Server-sent events support for aiohttp
Other
194 stars 35 forks source link

Add last event id property #431

Closed Olegt0rr closed 6 months ago

Olegt0rr commented 6 months ago

What do these changes do?

Since JS EventSource out of the box sends "Last-Event-Id" header, we should make a handy way to catch it. So, I added it as a property (Might be worth wrapping it up with aiohttp.reify decorator?)

Are there changes in behavior for the user?

Added handy way to get last event id (provided by client)

Related issue number

Closes #148

Checklist

codecov[bot] commented 6 months ago

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (0cec366) 67.71% compared to head (60542f3) 68.24%. Report is 1 commits behind head on master.

Files Patch % Lines
aiohttp_sse/__init__.py 0.00% 8 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #431 +/- ## ========================================== + Coverage 67.71% 68.24% +0.52% ========================================== Files 4 4 Lines 350 381 +31 Branches 40 45 +5 ========================================== + Hits 237 260 +23 - Misses 113 121 +8 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.