Skip to content

[Audit] Duplicated "list events for a wallet" implementations with divergent feature sets #1271

Description

@K1NGD4VID

Filed from the second-wave repository audit (issue 69/100). See the audit summary for full category context.

  • Location: backend/src/controllers/user.controller.ts:116-169 vs. backend/src/routes/v1/events.routes.ts:69-141
  • Problem: Two near-identical implementations of "paginated events by sender/recipient" exist with different feature sets (one supports comma-separated type filtering and includes the related stream, the other doesn't) and duplicated regex/where-clause logic.
  • Evidence: Two independent handlers covering the same query shape with inconsistent capabilities.
  • Suggested implementation: Extract one shared listEventsForWallet helper supporting the union of both features, used by both endpoints (or consolidate to one endpoint if the duplication is unintentional).
  • Acceptance criteria: Both call sites support identical filtering capabilities via one shared implementation.
  • Difficulty: M
  • Expected impact: Removes feature-parity drift between two endpoints doing the same conceptual job.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbackendBackend related tasksrefactorRefactoring existing codesecond-wave-auditFiled from the second-wave repo audit (100 issues)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions