Skip to content

Fix/issues with running commandprocessor samples#3500

Merged
preardon merged 5 commits into
BrighterCommand:masterfrom
andrewjpoole:fix/issues-with-running-commandprocessor-samples
Feb 19, 2025
Merged

Fix/issues with running commandprocessor samples#3500
preardon merged 5 commits into
BrighterCommand:masterfrom
andrewjpoole:fix/issues-with-running-commandprocessor-samples

Conversation

@andrewjpoole

Copy link
Copy Markdown
Contributor

I pulled down the Brighter code to explore and understand how it works, however I found some issues with the CommandProcessor samples, so here's a pr to fix them.
One was related to the _successor field of RequestHandlerAsync.cs which was being set recursively, causing a stackoverflow exception. I am not sure if my fix is the correct one or in the right place, but at least its a start!

This screenshot illustrates the issue I was seeing
644ae2f6-1357-4070-b2c5-6a4bd6644955

…rldInternalBus otherwise MessagePump throws Unable to cast object of type 'HelloWorld.GreetingCommandHandler' to type 'Paramore.Brighter.IHandleRequestsAsync
…on RequestHandlerAsync, by only asigning the _successor if it is different to this, i.e. the current instance.
@CLAassistant

CLAassistant commented Feb 7, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Health Quality Gates: OK

Change in average Code Health of affected files: +0.00 (9.38 -> 9.38)

View detailed results in CodeScene

@iancooper

Copy link
Copy Markdown
Member

Hi @andrewjpoole thanks. Things are in flux a bit as we push towards V10 release candidate, so the 9x branch is much more stable right now. But thanks for this PR. I'll take a look.

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Gates Passed
6 Quality Gates Passed

See analysis details in CodeScene

Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.

@preardon preardon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me

@preardon preardon merged commit 3c92ffe into BrighterCommand:master Feb 19, 2025
@andrewjpoole andrewjpoole deleted the fix/issues-with-running-commandprocessor-samples branch February 20, 2025 13:29
DevJonny pushed a commit to DevJonny/Brighter that referenced this pull request Feb 28, 2026
* fix: typo in CommandHandler

* fix: CommandHandler should be async in samples/CommandHandler/HelloWorldInternalBus otherwise MessagePump throws Unable to cast object of type 'HelloWorld.GreetingCommandHandler' to type 'Paramore.Brighter.IHandleRequestsAsync

* fix: prevent StackOverflow exception related to the _successor field on RequestHandlerAsync, by only asigning the _successor if it is different to this, i.e. the current instance.

* fix: removing accidentally checked in launchsettings.json file

---------

Co-authored-by: Paul Reardon <Paul@ReardonTech.UK>
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.

4 participants