Skip to content

refactor: extract IBinaryDiffer to Core — fix PatchMiddleware circular dependency (#346) - #347

Merged
JusterZhu merged 1 commit into
masterfrom
feat/extract-ibinarydiffer
May 24, 2026
Merged

refactor: extract IBinaryDiffer to Core — fix PatchMiddleware circular dependency (#346)#347
JusterZhu merged 1 commit into
masterfrom
feat/extract-ibinarydiffer

Conversation

@JusterZhu

Copy link
Copy Markdown
Collaborator

Summary

Eliminates the circular dependency between Core and Differential by extracting IBinaryDiffer into Core. PatchMiddleware now performs real differential patching when a differ is injected.

Changes

New: GeneralUpdate.Core.Differential.IBinaryDiffer

  • Core now owns the binary differ abstraction
  • PatchMiddleware can use it without referencing the Differential assembly

Updated: GeneralUpdate.Differential.Abstractions.IBinaryDiffer

  • Now inherits from Core's IBinaryDiffer (backward compatible)
  • All existing Differential code continues to work unchanged

Updated: AbstractBootstrap

  • Added .BinaryDiffer<T>() extension point for injecting IBinaryDiffer implementations

Updated: PatchMiddleware

  • Accepts IBinaryDiffer? via constructor injection
  • When a differ is provided: performs real binary patching via DirtyAsync()
  • Without injection: gracefully skips with a log message
  • Added parameterless constructor for PipelineBuilder compatibility

Verification

  • dotnet build src/c#/GeneralUpdate.slnx0 errors, 0 warnings
  • All 11 projects compile successfully

Closes #346

…r dependency

- Created IBinaryDiffer in Core (GeneralUpdate.Core.Differential namespace)
- Differential's IBinaryDiffer now inherits from Core interface (backward-compat)
- Added .BinaryDiffer<T>() extension point to AbstractBootstrap
- PatchMiddleware now accepts IBinaryDiffer via constructor injection
  and performs real differential patching when a differ is provided
- Without injection, PatchMiddleware gracefully skips with a log message

Closes #346
Copilot AI review requested due to automatic review settings May 24, 2026 08:00
@JusterZhu JusterZhu added the refactor Refactor some existing code. label May 24, 2026
@JusterZhu
JusterZhu merged commit 10ce007 into master May 24, 2026
1 check failed
@JusterZhu
JusterZhu deleted the feat/extract-ibinarydiffer branch May 24, 2026 08:00
@JusterZhu
JusterZhu removed the request for review from Copilot May 24, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactor some existing code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

T3: Extract IBinaryDiffer to Core — fix PatchMiddleware circular dependency

1 participant