Renewals return the start position instead of the current watermark

Open
#88 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go, postgresql, sql
Domain
backend

Research direction

Start in faucet/subscribe.go at the renewal branch (L276-280) that answers with the stored position, then read the renewal upsert in pgstore/queries/events.sql (L282-288) to see why the column never moves. Compare against the watermark that deliveries compute in pgstore/queries/deliveries.sql (L71-89) and decide whether to select it or advance the stored value. Done means a renewal response carries the same safe-to-persist cursor as a delivery; run the pgstore tests after changing the query.

Written by the indexing model from the issue text.

Description

Problem

A renewal answers with the subscription's stored position (faucet/subscribe.go). The upsert keeps that value unchanged on a renewal of the same target (pgstore/queries/events.sql), and no other query moves it. It is where delivery started, not where it is now.

The spec describes the refresh cursor as a "safe-to-persist watermark; advances the client's cursor even if no events arrive before the next refresh" (events.mdx L439, see also L447).

Effect

A client that persists the cursor from each refresh, as the spec suggests, moves its cursor back to the start on every renewal. After a lapse it resubscribes from there and gets every event since the start again. I read this from the code and did not run it.

Proposal

Return the same watermark that deliveries carry (pgstore/queries/deliveries.sql) in the renewal response.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

Dominant language
Go
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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 coder/faucet

All issues in coder/faucet

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.