Skip to content

Conversation

@petruki
Copy link
Member

@petruki petruki commented Jan 1, 2026

This pull request introduces a significant refactor to the regex matching strategy, replacing the use of child processes with Node.js worker threads for improved performance and reliability. It also removes unnecessary asynchronous code from the strategy processing and updates related tests to use synchronous logic. The most important changes are grouped below:

TimedMatch Regex Matching Refactor

  • Replaces child process-based regex matching in TimedMatch with a worker threads implementation, using SharedArrayBuffer and atomics for communication and timeout control. The worker is now initialized and terminated via explicit static methods. (src/helpers/timed-match/index.js, src/helpers/timed-match/match-proc.js, src/helpers/timed-match/match.js) [1] [2] [3] [4]
  • Updates the application entry point to initialize the TimedMatch worker at startup. (src/app.js)

Removal of Unnecessary Async/Await

  • Refactors all strategy and criteria evaluation logic to be synchronous, removing async/await from processOperation, processREGEX, checkStrategy, and related functions. (src/models/config-strategy.js, src/services/criteria.js) [1] [2] [3] [4] [5] [6]

Test Suite Updates

  • Updates unit tests to initialize and terminate the TimedMatch worker, clear the blacklist before tests, and remove all async/await from test cases to match the new synchronous API. (tests/unit-test/config-strategy.test.js) [1] [2] [3] [4]

Minor Configuration Change

  • Removes src/helpers/cache/worker.js from the SonarQube exclusions in sonar-project.properties, ensuring this file is now included in code quality analysis. (sonar-project.properties)

@petruki petruki added this to the v1.1.0 milestone Jan 1, 2026
@petruki petruki self-assigned this Jan 1, 2026
@petruki petruki added the enhancement New feature or request label Jan 1, 2026
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 1, 2026

@petruki petruki merged commit 9a6e61a into master Jan 1, 2026
5 checks passed
@petruki petruki deleted the staging branch January 1, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants