Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions api-contracts/v1/streams.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ service V1Streams {
rpc Publish(PublishStreamMessageRequest) returns (PublishStreamMessageResponse) {}
rpc Subscribe(SubscribeStreamRequest) returns (stream StreamMessage) {}
rpc GetTopicMetadata(GetStreamTopicMetadataRequest) returns (StreamTopicMetadata) {}
rpc Reset(ResetStreamTopicRequest) returns (ResetStreamTopicResponse) {}
}

message PublishStreamMessageRequest {
Expand Down Expand Up @@ -61,3 +62,10 @@ message StreamTopicMetadata {
// when the newest retained message was stored; unset when none is retained
google.protobuf.Timestamp last_published_at = 6;
}

message ResetStreamTopicRequest {
string namespace = 1;
string topic = 2;
}

message ResetStreamTopicResponse {}
10 changes: 10 additions & 0 deletions cmd/hatchet-migrate/migrate/migrations/20261013133204_v1_0_172.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-- +goose Up
-- +goose StatementBegin
-- subscribers without a cursor start after this offset (see ResetStreamTopic)
ALTER TABLE v1_stream_topic ADD COLUMN starting_offset BIGINT NOT NULL DEFAULT 0;
-- +goose StatementEnd

-- +goose Down
-- +goose StatementBegin
ALTER TABLE v1_stream_topic DROP COLUMN starting_offset;
-- +goose StatementEnd
90 changes: 90 additions & 0 deletions examples/typescript/durable-streams/run.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions examples/typescript/durable-streams/worker.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions examples/typescript/durable-streams/workflow.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions examples/typescript/e2e-worker.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions frontend/docs/content/docs/reference/changelog/typescript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ description: "Release notes for every Hatchet TypeScript SDK release, newest fir

{/* AUTOGENERATED — do not edit. Run `task sync-changelog` to regenerate from sdks/typescript/CHANGELOG.md */}

## v1.38.0 - 2026-10-13

### Added

- Added `hatchet.streams.reset(topic, { namespace })`, after which `events()` calls without a cursor start after the topic's latest message. Readers already iterating, and calls with a cursor, are unaffected.

## v1.37.0 - 2026-10-07

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ readers can resume from a cursor.

##### `events()`

Yields topic's messages after options.cursor, or from the oldest retained.
Yields topic's messages after options.cursor, or from the oldest retained
(or, once the topic is reset, after the reset).
If the connection drops, it resubscribes from the last message yielded, so
nothing is skipped or repeated. Ends when the server hangs up an idle
subscription, options.signal aborts, or the caller stops iterating; throws
Expand Down Expand Up @@ -52,6 +53,25 @@ Returns

`Promise`\<`void`\>

<a id="reset"></a>

##### `reset()`

Makes events() calls without a cursor start after the topic's latest
message. Readers already iterating, and any call with a cursor, are
unaffected.

Parameters

| Parameter | Type | Description |
| ---------- | -------------------------------------------- | --------------------------- |
| `topic` | `string` | the topic to reset |
| `options?` | `Pick`\<`StreamCallOptions`, `"namespace"`\> | optional namespace override |

Returns

`Promise`\<`void`\>

<a id="topicmetadata"></a>

##### `topicMetadata()`
Expand Down
Loading
Loading