Skip to content

Fix submission retries, withdrawal validation and demo profiles - #19

Merged
nathanaelcheramlak merged 5 commits into
iCog-Labs-Dev:devfrom
AlexKalll:fix/backend-e2e-workflow
Sep 11, 2026
Merged

nathanaelcheramlak merged 5 commits into
iCog-Labs-Dev:devfrom
AlexKalll:fix/backend-e2e-workflow

Conversation

@AlexKalll

Copy link
Copy Markdown
Collaborator

Why

Fresh end-to-end testing found that demo users lacked required profile data,
valid reference-data/submission requests were rejected by validation, and
rejected submissions could not reliably be retried. Submission progress also
advanced by the configured batch size instead of the number of new work items.

Changes

  • Complete the existing demo-user seed for new and existing accounts, including Amharic profile/location data and linked contributor/reviewer scores.
  • Preserve earned wallet balances and scores on seed reruns; keep demo seeding opt-in and blocked in production.
  • Add strict validation for nested text submissions and compatible validation metadata for annotation/rejection reference-data requests.
  • Validate previous submissions separately per microtask so rejected work can be retried while pending/approved duplicates remain rejected.
  • Count only newly submitted microtasks toward progress; retries do not count twice or renew assignment deadlines. Cover both text and audio service paths.
  • Accept valid two-decimal withdrawal amounts such as 0.29 without floating-point false rejections.
  • Update the README Test Accounts section with current credentials and native/Docker seeding commands.

Tests

  • Full backend ESLint check passed with no errors; existing warnings remain.
  • TypeScript check and Nest build passed.
  • All 27 Jest suites / 243 tests passed with coverage enabled.
  • Added regression coverage for request validation, rejected retries, independent retry limits, partial/mixed progress, duplicate rejection, and transaction rollback.
  • Added mocked-provider tests for withdrawal reservation, settlement, insufficient balance, ambiguous transport errors, and reversing failed payouts exactly once.

Live Verification

A fresh local API workflow passed using PostgreSQL, Redis, RabbitMQ, and MinIO:
project creation/image upload, task setup, membership/mappings, distribution,
two contributor batches, approval/rejection, correction/retry, final approval,
wallet credits, transaction history, and task closure. Ownership and unassigned
reviewer restrictions were also checked.

Invalid withdrawal requests were rejected. With payouts disabled, a valid
withdrawal returned the expected unavailable response without a debit.
No real payment-provider call or money transfer was performed.

Scope And Deployment Notes

  • No database migration, global validation weakening, or payout enablement.
  • The seed prepares users only; it does not pre-create projects or task progress.
  • Seed reruns update demo passwords/profiles/activation, so use a development database only.
  • Companion frontend/mobile fixes align their requests with these contracts.
  • High-concurrency submission behavior and real payment-provider settlement are not established by these tests.
  • Personal guides, local API-run scripts/results, environment files, and secrets are excluded.

### Commits, Oldest First

| Commit | Message |
| --- | --- |
| `f3d0035` | `fix(seed): prepare complete demo user profiles` |
| `59ccb64` | `fix: validate submissions and preserve progress on rejected retries` |
| `1142fb5` | `fix(finance): accept valid decimal withdrawals and test payout safety` |
| `671a787` | `docs: explain demo seeding and record workflow fixes` |

@nathanaelcheramlak
nathanaelcheramlak merged commit 3b1bbdc into iCog-Labs-Dev:dev Sep 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants