fix(selfhost): paginate Orb export by event_at and target_id tie-break - #1917
Conversation
A timestamp-only export cursor skipped remaining PRs when multiple resolved rows shared the same event_at and batchSize was smaller than the tie group. Persist last_exported_target_id and page with a composite watermark. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-01 16:15:00 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Summary
last_exported_target_idtoorb_export_cursor(migration0088_orb_export_cursor_target_id.sql) so the Orb fleet exporter can resume within a tiedevent_atgroup.(event_at > cursor) OR (event_at = cursor AND target_id > cursorTargetId)andORDER BY event_at ASC, target_id ASC.event_atexported in batches of two.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Issue creation is currently blocked for contributor accounts on the upstream repo; this is a focused data-loss fix with regression tests.
Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥97% coverage of the lines AND branches you changed (aim for 98%+ on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
npm run test:ciruns in GitHub Actions;test/unit/selfhost-orb-collector.test.tscovers the new composite-cursor path.Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.UI Evidence
N/A — self-host Orb export logic only.
Notes
Made with Cursor