Skip to content

messaging: a message sent straight from a request carries the request's language (#9160) - #9166

Merged
delchev merged 2 commits into
eclipse-dirigible:masterfrom
NicoleNG18:issue-9160-message-language-from-request
Dec 4, 2026
Merged

delchev merged 2 commits into
eclipse-dirigible:masterfrom
NicoleNG18:issue-9160-message-language-from-request

Conversation

@NicoleNG18

@NicoleNG18 NicoleNG18 commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Cause

OriginatingUserProperty.stamp stamped dirigible_originating_language from ThreadLanguage.get() only. Since #9141 (#9043) HttpContextFilter clears the thread language at the start of every request and nothing binds it from Accept-Language, so a message that custom/ code sends straight through the SDK Producer during a request left without a language, and its listener resolved refusals, CheckMessages texts and the _LANG overlay in the base language. Events written through a generated repository were unaffected: the outbox reads UserFacade.findLanguage().

Change

stamp reads the language by the outbox's rule: the bound thread language first (a handler re-sending keeps the originating one), else the request's Accept-Language, else none (a job, a seed - unchanged). engine-listeners does not depend on api-security, so it uses core-base's RequestLanguage.of(request) with the request from UserRequestVerifier - the same rule UserFacade.findLanguage applies (first range, * = none). The user stamp and the property names are unchanged.

Verification

  • OriginatingUserPropertyTest (new): a bound language wins over the request's; with none bound the request's first range is stamped (bg-bg, lower case, exactly as the outbox records it); * stamps none; neither stamps none. engine-listeners unit suite green (120).
  • IntentEventLanguageIT: a new method publishes a custom/ controller that calls Producer.sendToQueue and a queue handler that refuses through CheckMessages and reads a multilingual row; called with Accept-Language: bg-BG the handler's remark is Bulgarian, without a language it is the default text. Green with the change (both methods), and the new method fails at the Bulgarian assertion with OriginatingUserProperty reverted.
  • Follow-up commit: OriginatingUserPropertyTest tore down a context also after the test that never set one up, which left the surefire thread half-open and failed MessageProducerTest (5 NPEs) whenever it ran later on that thread - both tests legs of the first CI run. It now tears down only what it set up. Reproduced with -Dsurefire.runOrder=reversealphabetical (5 errors before, 0 after); the engine-listeners suite is green in both orders (120).
  • mvn formatter:validate on both modules with the cache wiped.
  • Not run: the full IT suite, PostgreSQL.

Fixes #9160

🤖 Generated with Claude Code

NicoleNG18 and others added 2 commits December 4, 2026 19:55
…'s language (eclipse-dirigible#9160)

OriginatingUserProperty.stamp read only ThreadLanguage, which the request
filter clears since eclipse-dirigible#9043 and nothing binds from Accept-Language, so a
message custom/ code sent during a request left without
dirigible_originating_language and its listener answered in the base
language. It now reads the language the way the outbox does: the bound
thread language first, else the request's Accept-Language
(RequestLanguage.of, core-base), else none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…text it set up (eclipse-dirigible#9160)

An unmatched ThreadContextFacade.tearDown() after the test that never set one up left the
thread's context half-open, and MessageProducerTest, run later on the same surefire thread,
failed reading it with a NullPointerException (both unit-test legs of eclipse-dirigible#9166).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@delchev
delchev merged commit 210c724 into eclipse-dirigible:master Dec 4, 2026
16 checks passed
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.

messaging: a message sent straight from a request carries no language since #9141, so its listener answers in the base language

2 participants