fix(api): sync removed members and fail tasks without a ledger

Remove now reconciles document slots and returns ERR_DUTY_SYNC on
failure. CreateOrGetDocument errors abort the task. The frontend
refreshes workflow docs after add, update, restore, and remove.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
weichen
2026-09-13 22:29:53 +00:00
co-authored by Cursor
parent 9a19bcc12c
commit 8b6bf2cca1
9 changed files with 241 additions and 55 deletions
+2 -2
View File
@@ -73,6 +73,6 @@ export TEST_DATABASE_URL="${TEST_URL}"
echo "[info] running isolated duty-sync PostgreSQL tests"
# 包串行,避免并行 goose 抢同一临时库。
go test ./internal/docduty -count=1 -run 'Duty|ReviewerDuty|DocumentDuty|OwnerAuthor|HealBinding'
go test ./internal/docduty -count=1 -run 'Duty|ReviewerDuty|DocumentDuty|OwnerAuthor|HealBinding|ReconcileMemberDuty'
go test ./internal/authz -count=1 -run 'ConcurrentLastWriter|DocumentDuty'
go test ./internal/server -count=1 -run 'AuthorizeDocRevision|ResolveUpdateProjectRole'
go test ./internal/server -count=1 -run 'AuthorizeDocRevision|ResolveUpdateProjectRole|DutyChangeForRemove|WriteDutySyncError'