Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Conversation

@perfectra1n
Copy link
Member

@perfectra1n perfectra1n commented Jun 17, 2025

… in customRequestHandler

  • added unit tests
  • and normalized functionality :)

@perfectra1n perfectra1n marked this pull request as ready for review June 17, 2025 23:00
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 17, 2025
Copy link
Contributor

@eliandoran eliandoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are type errors:

  Error: src/routes/custom.ts(49,17): error TS2322: Type 'RegExpMatchArray | null' is not assignable to type 'null'.
    Type 'RegExpMatchArray' is not assignable to type 'null'.
  Error: src/routes/custom.ts(71,39): error TS2339: Property 'slice' does not exist on type 'never'.
  Error: src/routes/custom.ts(49,17): error TS2322: Type 'RegExpMatchArray | null' is not assignable to type 'null'.
    Type 'RegExpMatchArray' is not assignable to type 'null'.
  Error: src/routes/custom.ts(71,39): error TS2339: Property 'slice' does not exist on type 'never'.
  Error: src/services/utils.spec.ts(647,59): error TS2322: Type 'null' is not assignable to type 'string'.
  Error: src/services/utils.spec.ts(648,69): error TS2322: Type 'undefined' is not assignable to type 'string'.
  Error: src/services/utils.spec.ts(672,52): error TS2322: Type 'null' is not assignable to type 'string'.
  Error: src/services/utils.spec.ts(673,62): error TS2322: Type 'undefined' is not assignable to type 'string'.
  > tsc --build --emitDeclarationOnly
  
  Error: src/routes/custom.ts(49,17): error TS2322: Type 'RegExpMatchArray | null' is not assignable to type 'null'.
    Type 'RegExpMatchArray' is not assignable to type 'null'.
  Error: src/routes/custom.ts(71,39): error TS2339: Property 'slice' does not exist on type 'never'.
  Error: src/routes/custom.ts(49,17): error TS2322: Type 'RegExpMatchArray | null' is not assignable to type 'null'.
    Type 'RegExpMatchArray' is not assignable to type 'null'.
  Error: src/routes/custom.ts(71,39): error TS2339: Property 'slice' does not exist on type 'never'.
  Error: src/services/utils.spec.ts(647,59): error TS2322: Type 'null' is not assignable to type 'string'.
  Error: src/services/utils.spec.ts(648,69): error TS2322: Type 'undefined' is not assignable to type 'string'.
  Error: src/services/utils.spec.ts(672,52): error TS2322: Type 'null' is not assignable to type 'string'.
  Error: src/services/utils.spec.ts(673,62): error TS2322: Type 'undefined' is not assignable to type 'string'.

Comment on lines 53 to 57
} catch (e: unknown) {
const [errMessage, errStack] = safeExtractMessageAndStackFromError(e);
log.error(`Testing path for label '${attr.attributeId}', regex '${pattern}' failed with error: ${errMessage}, stack: ${errStack}`);
continue;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what circumstances would a regex fail?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The log.error() would trigger I believe in the following scenarios:

  • Invalid regex syntax in the attr.value (like unclosed brackets [abc, invalid quantifiers, etc.)
  • Runtime errors during path.match() execution (though obviously "shouldn't happen")

@eliandoran eliandoran marked this pull request as draft June 18, 2025 20:13
@perfectra1n
Copy link
Member Author

Why is it that I always manage to break my local repo 😔

@perfectra1n perfectra1n marked this pull request as ready for review June 19, 2025 23:41
@eliandoran eliandoran added this to the v0.96.0 milestone Jun 20, 2025
@eliandoran eliandoran merged commit a861def into develop Jun 20, 2025
10 checks passed
@eliandoran eliandoran deleted the fix/lint-server-url branch June 20, 2025 07:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants