Skip to content

Fix/infra and backend improvements#530

Merged
ogazboiz merged 4 commits into
LabsCrypt:mainfrom
Mosas2000:fix/infra-and-backend-improvements
May 29, 2026
Merged

Fix/infra and backend improvements#530
ogazboiz merged 4 commits into
LabsCrypt:mainfrom
Mosas2000:fix/infra-and-backend-improvements

Conversation

@Mosas2000
Copy link
Copy Markdown
Contributor

@Mosas2000 Mosas2000 commented May 29, 2026

  1. Closes [Infra] Codecov upload step fails CI when CODECOV_TOKEN is missing (fail_ci_if_error: true) #528 - Codecov CI failures fixed
    Changed fail_ci_if_error: true to false for both backend and contracts Codecov upload steps
    CI will no longer fail when CODECOV_TOKEN is missing or invalid
    Coverage upload is now best-effort and won't block passing tests

  2. Closes [Backend] Add pagination to GET /v1/users/:publicKey/events #506 - Pagination added to getUserEvents
    Added limit (default 50, max 200) and offset query parameters
    Returns paginated envelope with data, total, hasMore, limit, and offset fields
    Maintains reverse-chronological ordering
    Updated Swagger documentation in user.routes.ts

  3. Closes [Backend] Guard against division-by-zero in createStream controller endTime calculation #507 - Division-by-zero guard in createStream
    Added validation to ensure ratePerSecond > 0 before computing endTime
    Added validation for all numeric fields (streamId, startTime, depositedAmount)
    Returns 400 with clear error messages instead of 500 on invalid input
    Handles RangeError gracefully

  4. Closes [Backend] Remove dead unauthenticated legacy SSE route file routes/events.routes.ts #508 - Dead legacy SSE route file removed
    events.routes.ts
    (confirmed no imports)
    Removed unauthenticated SSE subscribe handler security risk
    Active authenticated version remains in
    events.routes.ts

Closes #528
Closes #506
Closes #507
Closes #508

Mosas2000 added 4 commits May 29, 2026 04:21
Both backend and contracts CI jobs were failing when CODECOV_TOKEN
was missing or invalid, even when all tests passed. Changed both
upload steps to fail_ci_if_error: false so coverage upload is
best-effort and does not block CI on token issues.
The getUserEvents endpoint was returning unbounded results which could
grow without limit for active wallets. Added limit and offset query
parameters with sensible defaults (limit: 50, max: 200) and return
a paginated envelope consistent with other endpoints including data,
total, hasMore, limit, and offset fields. Maintains reverse-chronological
ordering and updated Swagger documentation.
Added validation to prevent RangeError when ratePerSecond is zero.
The endpoint now validates that ratePerSecond and depositedAmount
are greater than zero before computing endTime, returning a 400
with a clear message instead of a 500. Also added proper parsing
and validation for all numeric fields to handle malformed input
gracefully.
Deleted backend/src/routes/events.routes.ts which was not imported
anywhere in the codebase. This file contained an unauthenticated
SSE subscribe handler that could have been a security risk if
accidentally re-mounted. The active authenticated version exists
in routes/v1/events.routes.ts.
@ogazboiz ogazboiz merged commit 37d8af0 into LabsCrypt:main May 29, 2026
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment