docs: move Durable Objects migration from TECH_DEBT to TODO

The race condition is an accepted limitation of KV; the DO migration
is a future feature rather than active tech debt to remediate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Julien Herr
2026-05-22 10:31:41 +02:00
parent a0415cdc41
commit 582108a8e3
2 changed files with 9 additions and 8 deletions
+2 -3
View File
@@ -28,10 +28,9 @@ Generated: 2026-05-22
## Phase 3 — Ongoing / Infrastructure ## Phase 3 — Ongoing / Infrastructure
| # | Task | Priority | | # | Task | Priority |
| ----- | ---------------------------------------------------------- | -------- | | ----- | ---------------------------------------------------- | -------- |
| P1-4 | Structured logging + error aggregation | 36 | | P1-4 | Structured logging + error aggregation | 36 |
| P1-5 | Rate limiting (Cloudflare WAF rules) | 24 | | P1-5 | Rate limiting (Cloudflare WAF rules) | 24 |
| P1-1 | Migrate feed metadata to Durable Objects for atomic writes | 36 |
| P2-10 | Extract constants module (`src/config/constants.ts`) | 12 | | P2-10 | Extract constants module (`src/config/constants.ts`) | 12 |
| P2-11 | Split `admin.ts` into sub-modules | 8 | | P2-11 | Split `admin.ts` into sub-modules | 8 |
@@ -52,7 +51,7 @@ Generated: 2026-05-22
**Race condition in KV metadata updates** (`src/lib/email-processor.ts`) **Race condition in KV metadata updates** (`src/lib/email-processor.ts`)
Two concurrent emails to the same feed read-modify-write the metadata non-atomically. Two concurrent emails to the same feed read-modify-write the metadata non-atomically.
The second writer silently overwrites the first's changes. Accepted limitation of KV; The second writer silently overwrites the first's changes. Accepted limitation of KV;
long-term fix is Cloudflare Durable Objects for serialised writes. see TODO.md for the Durable Objects migration roadmap item.
**Email ingest path has zero tests** (`src/routes/inbound.ts`) **Email ingest path has zero tests** (`src/routes/inbound.ts`)
The most critical path in the system is entirely unguarded. Required: happy path, The most critical path in the system is entirely unguarded. Required: happy path,
+2
View File
@@ -23,3 +23,5 @@ Feature gaps identified by comparing with [kill-the-newsletter](https://github.c
- [x] **Email attachments as RSS enclosures** — store attachments in Cloudflare R2 and expose them as `<enclosure>` elements in the feed. kill-the-newsletter serves them at `/files/{enclosureId}/{filename}`. - [x] **Email attachments as RSS enclosures** — store attachments in Cloudflare R2 and expose them as `<enclosure>` elements in the feed. kill-the-newsletter serves them at `/files/{enclosureId}/{filename}`.
- [ ] **WebSub (PubSubHubbub) push notifications** — notify subscribers in real time when a new email arrives, instead of requiring them to poll the feed. Requires either integrating a public WebSub hub or implementing the hub protocol directly. - [ ] **WebSub (PubSubHubbub) push notifications** — notify subscribers in real time when a new email arrives, instead of requiring them to poll the feed. Requires either integrating a public WebSub hub or implementing the hub protocol directly.
- [ ] **Migrate feed metadata to Durable Objects for atomic writes** — the current KV-based metadata store has a read-modify-write race condition: two concurrent emails to the same feed can silently overwrite each other's changes. Cloudflare Durable Objects serialise access per feed and eliminate the race entirely. Requires replacing `feed:<feedId>:metadata` KV writes in `src/lib/email-processor.ts` with a Durable Object that exposes an `appendEmail()` RPC, updating `wrangler.toml` with a DO binding, and migrating existing metadata at deploy time.