Skip to content

Fix routing order and glossary jar loading - #2820

Merged
simonredfern merged 1 commit into
OpenBankProject:developfrom
hongwei1:bugfix/treakRoutingOrderAndGlossaryJarLoading
Jun 1, 2026
Merged

simonredfern merged 1 commit into
OpenBankProject:developfrom
hongwei1:bugfix/treakRoutingOrderAndGlossaryJarLoading

Conversation

@hongwei1

@hongwei1 hongwei1 commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Routing order (Http4sApp): v510/v600/v500 were placed before v700, causing every v7.0.0 request to traverse three extra middleware hops and produce spurious DEBUG 'No match' log entries. Reorder to v700 -> v600 -> v510 -> v500 so each request hits the correct version middleware on the first try.

Glossary jar loading (Glossary.scala): getListOfFiles() used new File(url.getPath) which breaks under the jar: protocol (path contains '!/' separator that File cannot resolve). Replace with getGlossaryEntries() that dispatches on url.getProtocol:

  • file: protocol keeps the existing File-based directory scan (IDE / unpacked)
  • jar: protocol uses JarURLConnection + jar.entries() enumeration and getInputStream() to read .md content directly from the fat-jar

Verified locally: jar mode now logs INFO for the jar: URL (no ERROR), glossary endpoint returns 851 items including all 436 file-backed entries (was 0 in jar mode).

Routing order (Http4sApp): v510/v600/v500 were placed before v700, causing every
v7.0.0 request to traverse three extra middleware hops and produce spurious DEBUG
'No match' log entries. Reorder to v700 -> v600 -> v510 -> v500 so each request
hits the correct version middleware on the first try.

Glossary jar loading (Glossary.scala): getListOfFiles() used new File(url.getPath)
which breaks under the jar: protocol (path contains '!/' separator that File cannot
resolve). Replace with getGlossaryEntries() that dispatches on url.getProtocol:
- file: protocol keeps the existing File-based directory scan (IDE / unpacked)
- jar:  protocol uses JarURLConnection + jar.entries() enumeration and
  getInputStream() to read .md content directly from the fat-jar

Verified locally: jar mode now logs INFO for the jar: URL (no ERROR), glossary
endpoint returns 851 items including all 436 file-backed entries (was 0 in jar mode).
@sonarqubecloud

sonarqubecloud Bot commented Jun 1, 2026

Copy link
Copy Markdown

@simonredfern
simonredfern merged commit b442ac0 into OpenBankProject:develop Jun 1, 2026
2 checks passed
@hongwei1
hongwei1 deleted the bugfix/treakRoutingOrderAndGlossaryJarLoading branch July 18, 2026 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants