Skip to content

refactor(worker): replace transaction any types - #759

Closed
adityabhatkar23 wants to merge 1 commit into
LabsCrypt:mainfrom
adityabhatkar23:refactor/prisma-transaction-client
Closed

refactor(worker): replace transaction any types#759
adityabhatkar23 wants to merge 1 commit into
LabsCrypt:mainfrom
adityabhatkar23:refactor/prisma-transaction-client

Conversation

@adityabhatkar23

Copy link
Copy Markdown
Contributor

Description

Replace any transaction client types in the Soroban event worker with Prisma's generated TransactionClient type to improve compile-time type safety.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test addition or update

Related Issues

Closes #633

Changes Made

  • Added Prisma type imports from the generated Prisma client
  • Replaced tx: any with tx: Prisma.TransactionClient in ensureSystemStream
  • Replaced tx: any with tx: Prisma.TransactionClient in all Prisma transaction callbacks
  • Enabled stronger compile-time validation for transaction-scoped Prisma operations

Testing

Test Coverage

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed

Test Steps

  1. Run npm run build
  2. Verify TypeScript compilation succeeds
  3. Confirm all transaction callbacks compile successfully with Prisma.TransactionClient

Breaking Changes

Breaking Changes:

  • None

Migration Guide:

  • No migration required

Screenshots/Demo

N/A

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published
  • I have checked for breaking changes and documented them if applicable

Additional Notes

  • This is a type-safety refactor only and does not change runtime behavior.
  • Using Prisma.TransactionClient allows TypeScript to validate transaction-scoped Prisma operations and catch typos or invalid model access during compilation.

@ogazboiz

ogazboiz commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

heads up: main's ci was broken (the Backend CI and Backend Docker Image CI jobs) until the fixes in #969 and #974 just landed, so the red backend/docker checks on this pr are almost certainly stale, they ran against the broken main. please rebase to re-test against the now-green main: git fetch origin && git rebase origin/main && git push --force-with-lease. once it's green i'll review and merge. (if a non-backend check like Frontend CI is still red after the rebase, that part is a real issue worth a look, since frontend ci was passing on main.)

@ogazboiz

ogazboiz commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

clean type-only improvement (tx: any -> Prisma.TransactionClient). the red is the same unrelated backend auth test, tsc passes. stale base, rebase: git fetch origin && git rebase origin/main && git push --force-with-lease.

@ogazboiz

ogazboiz commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

closing as superseded: the worker was rewritten and current soroban-event-worker.ts has typed tx params throughout, no any left to replace. 30 days without a response to the july 4 feedback. if you want to keep contributing, join us on Telegram: https://t.me/+DOylgFv1jyJlNzM0

@ogazboiz ogazboiz closed this Aug 3, 2026
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.

[Backend] Replace 'tx: any' tx-typing in soroban-event-worker.ts (10 sites)

2 participants