Skip to content

[2/N] feat(gateway): persist request receipts on Land#341

Open
albertywu wants to merge 1 commit into
wua/request-read-model-storagefrom
wua/request-receipt-admission
Open

[2/N] feat(gateway): persist request receipts on Land#341
albertywu wants to merge 1 commit into
wua/request-read-model-storagefrom
wua/request-receipt-admission

Conversation

@albertywu

@albertywu albertywu commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Create authoritative request summaries, exact change URI mappings, and queue receipt projections before publishing accepted Land requests.

Validation: make fmt && make build && make test && make e2e-test
)

// AdmissionWriter creates immutable request context and initial read-model projections.
type AdmissionWriter struct {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thinking if there is a better name for it? admission seems too generic for what we do here?

// See the License for the specific language governing permissions and
// limitations under the License.

package controller

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason to separate this tests from land_test?

}

// Create writes immutable request context and initial accepted projections.
// Writes are independent and stop on the first error; successful earlier writes are not rolled back.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stop-on-first-error with no rollback means a failure anywhere between the summary Create and the publish in Land leaves permanent accepted summary/queue rows for an sqid that never entered the pipeline. The client retry mints a fresh sqid (land.go:133), so these orphans accumulate rather than converge — and once the List API lands later in this stack, every queue viewer sees them forever. I couldn't find any reaper/reconciler for accepted-without-progress rows. That story doesn't have to be in this PR, but it needs to exist (or at least be written down) before List ships: e.g. a sweeper that errors out accepted rows older than some bound, or admission-before-counter idempotency so retries reuse the sqid.

Change: change,
LandStrategy: strategy,
}
if err := validateStoredIdentifier("generated sqid", landRequest.ID); err != nil {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Queue names in the (~235, 255] byte range pass the validateStoredIdentifier("queue", ...) check at line 104 but then deterministically fail here once /{seq} is appended, surfacing as a confusing "generated invalid request ID" user error for a request that was accepted as valid. Suggest bounding the queue-name length up front to leave room for the suffix, so the rejection happens at the right check with the right message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants