Allow passing custom Last-Event-Id

Open Beginner friendly
#7 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
node.js, typescript
Domain
api

Research direction

Start by locating EventStreamOptions and the code that creates the server-sent events request. Trace how Last-Event-Id is handled on connection and reconnection, then verify that a supplied lastEventId is sent for the initial stream without changing automatic reconnect behavior.

Written by the indexing model from the issue text.

Description

enhancement

Add an option lastEventId to EventStreamOptions, so the application can pass a custom last event ID.

This is important to have, so that a user can specify a last event ID per query parameter or similar, since the native DOM EventSource does not allow customizing the Last-Event-Id header.

Use case: The user wants to stream data from a certain point onwards (e.g. the last time they were online) when opening the stream. The Last-Event-Id header is only automatically set when reconnecting an already open stream that had some connectivity issue.

Dominant language
TypeScript
Stars
20
Forks
2
PR merge metrics
No merged PRs in 30d

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.

More from andywer/http-event-stream

All issues in andywer/http-event-stream

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.