BaryoDev / BaryoDev/barakoCMS

Delivery has no changed-since endpoint, so a build has to rebuild everything

Open
#560 0 comments 0 reactions 0 assignees View on GitHub
core enhancement
Dominant language
C#
Stars
6
Forks
7
Avg merge
4h 42m
Merged PRs (30d)
307

Description

There is no way to ask what changed. A consumer that wants to stay current has two options today: poll every entry, or hold an SSE connection open. Neither works for a build step, which is not running when the change happens.

`SitemapEndpoint` caps at `.Take(50000)`. A site at that size cannot rebuild everything on every publish, so without this the static export and the build triggers are limited to sites small enough that full rebuilds are free.

## What to add

```
GET /api/public/changes?since=
```

Returns the entries created, updated, unpublished or deleted since the token, plus a new token. No token means start here, do not replay history.

## The parts that need deciding

**Deletes and unpublishes have to appear.** A consumer that only learns about additions leaves removed content live on a static site forever. This is the requirement that makes the endpoint harder than a `WHERE UpdatedAt > x` query, because the row is gone.

**The token is a contract.** A timestamp is the obvious choice and the wrong one: application clocks skew across instances, and `ContentEvents` documents exactly this, separating domain time from storage time. The event store sequence is monotonic and is the right basis.

**Masking.** Goes through `PublicDelivery.ToPublic` like every other public read. An entry whose sensitivity changed from `Public` to something else has to read as a removal, not as an update carrying the newly masked fields.

## Done when

- A consumer holding a token gets exactly the entries that changed, including removals.
- Replaying the same token twice returns the same answer.
- An entry that becomes non-public appears as a removal, proven by a test.

Contributor guide

Open the contributing guide

Research direction

Start by tracing SitemapEndpoint, ContentEvents, and PublicDelivery.ToPublic to understand public delivery, event sequencing, and masking. Define the changes endpoint around the stated token and removal requirements, then add tests showing that replaying a token is stable and that an entry becoming non-public appears as a removal.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.