Backport UseConsole double-init + progress bar fixes from IdentityStream#3
Merged
Conversation
Brings in two fixes from the IdentityStream fork (https://github.com/IdentityStream/Hangfire.Console): - UseConsole() no longer throws when called more than once; returns silently instead (fixes pieceofsummer/Hangfire.Console#120, IdentityStream commit 988d3db) - DefaultProgressBar normalizes empty name/color to null (IdentityStream commit f9d4ebd) Version bumped to 1.4.5 with release notes.
There was a problem hiding this comment.
Pull request overview
Backports two bug fixes from the IdentityStream fork into Hangfire.Console while preserving the existing target frameworks and non-nullable code style, and bumps the package version to 1.4.5.
Changes:
- Make
UseConsole()tolerate repeated initialization attempts by returning instead of throwing. - Normalize empty progress bar
name/colorvalues tonullto avoid serializing empty strings. - Bump package version to
1.4.5and update release notes in the project file.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Hangfire.Console/GlobalConfigurationExtensions.cs | Changes double-init behavior of UseConsole() to return silently when already initialized. |
| src/Hangfire.Console/Progress/DefaultProgressBar.cs | Treats empty progress bar name/color values as null before writing console lines. |
| src/Hangfire.Console/Hangfire.Console.csproj | Updates VersionPrefix and adds v1.4.5 release notes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…empty-string tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings in two real bug fixes from the IdentityStream fork of this package, without pulling in the rest of their changes (file-scoped namespaces, nullable reference types, dropping
net451/netstandard1.3targets, etc.) so we preserve backwards compatibility.Imported fixes
1.
UseConsole()no longer throws on double-init988d3dbInvalidOperationException("Console is already initialized"); now returns silently. Strictly more permissive — any caller already catching the exception simply never enters the catch.2.
DefaultProgressBarnormalizes emptyname/colortonullf9d4ebdConsoleLine.ProgressName/TextColorwhere downstream code only checks fornull.Skipped (not portable without breaking changes)
net451/netstandard1.3targetsMessagerequiredThese are stylistic/architectural changes — not bug fixes — and importing them would break consumers on legacy targets or relying on current nullability semantics.
Version
1.4.4→1.4.5Validation
dotnet buildpasses for all 3 TFMs (net451,netstandard1.3,netstandard2.0)dotnet testpasses 122/122 on net8.0dotnet packproducesHangtools.Hangfire.Console.1.4.5.nupkg+.snupkg