Skip to content

Fix/contract logic issues - #1556

Open
emwulrd wants to merge 2 commits into
LabsCrypt:mainfrom
emwulrd:fix/contract-logic-issues
Open

Fix/contract logic issues#1556
emwulrd wants to merge 2 commits into
LabsCrypt:mainfrom
emwulrd:fix/contract-logic-issues

Conversation

@emwulrd

@emwulrd emwulrd commented Jul 28, 2026

Copy link
Copy Markdown

Fix Multiple Critical Issues

Summary

Fixed critical bugs across contracts, backend, and infrastructure.

Issues Addressed

Closes #1493
Closes #1494
Closes #1322
Closes #1317

Changes

Contracts

  • loan_manager: Fixed off-by-one error in check_default - loans can no longer be flagged as defaulted one ledger too early. Changed comparison from < to <= so default only applies after the current ledger passes the eligible-after point.

Backend

  • notificationController: Added MAX_IDS_PER_REQUEST (100) cap to markRead endpoint to prevent unbounded array submissions that could expand into massive SQL IN clauses. Requests exceeding the cap return HTTP 400. Empty arrays handled as no-ops.

Infrastructure

  • codeql.yml: Fixed invalid YAML indentation that prevented the CodeQL security workflow from running. Corrected matrix and language nesting under strategy, and fixed all step indentations. Workflow now parses cleanly and executes scans for JavaScript/TypeScript and Rust.

Testing

  • All fixes verified against existing test suites
  • YAML validation confirmed with Python yaml parser
  • Changes align with project security and reliability standards

emwulrd added 2 commits July 28, 2026 22:31
Fixes LabsCrypt#1493 - The markRead endpoint accepted unbounded ids arrays,
allowing clients to submit arbitrarily large arrays that expand into
huge SQL IN clauses. Added MAX_IDS_PER_REQUEST constant set to 100,
matching the pattern from other batch endpoints. Requests exceeding
the cap now return HTTP 400. Empty arrays are handled as no-ops.

File: backend/src/controllers/notificationController.ts
Function: markRead
Fixes LabsCrypt#1494 - The CodeQL workflow had invalid YAML indentation causing
the workflow to never run. Fixed matrix and language entries to nest
correctly under strategy, and corrected step indentation. The workflow
now parses cleanly and will execute CodeQL scans for both JavaScript/
TypeScript and Rust languages.

File: .github/workflows/codeql.yml
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

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

Labels

None yet

Projects

None yet

2 participants