Skip to content

fix(import): make rollback all-or-nothing at the queue level - #1321

Merged
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
Priyanshu1-62:fix/rollback-atomic-requeue
Aug 31, 2026
Merged

fix(import): make rollback all-or-nothing at the queue level#1321
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
Priyanshu1-62:fix/rollback-atomic-requeue

Conversation

@Priyanshu1-62

Copy link
Copy Markdown
Contributor

Description

Summary:

This addresses the import atomicity issue: "validate all rows up front" and "roll back atomically."

  • validator.ts: No code changes. runValidationPipeline already iterates every row regardless of earlier row failures and returns full succeeded/failed/records results, the "validate all rows up front" behavior already exists as written.
  • rollback.ts: Updated so rollback is all-or-nothing at the queue level. Previously, rollback() unconditionally cleared all registered actions after attempting them, even when some failed, silently discarding the fact that cleanup was incomplete. Now the queue only clears on full success; failed actions remain registered so a retry only re-attempts what didn't complete.

Implementation Details:

  • RollbackResult gains a complete: boolean field, true only when every action succeeded and the queue is now empty.
  • rollback() no longer unconditionally zeroes actions. On partial failure, failed actions are re-queued in their original relative order instead of being discarded.
  • size now honestly reflects incomplete rollback state (non-zero after a partial failure) instead of always reading 0 post-rollback.
  • register(), clear(), and execution order (reverse/LIFO) are unchanged.

Related Issue

Closes #1180

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • No console errors
  • Uses Lucide icons consistently
  • Responsive design implemented
  • Starknet best practices followed

@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@Priyanshu1-62 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Thank you for conyributing to the project

@RUKAYAT-CODER
RUKAYAT-CODER merged commit 0e7282a into rinafcode:main Aug 31, 2026
6 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.

Validate imported rows and roll back on partial failure

2 participants