Skip to content

fix: correct DI and config wiring so app starts cleanly#51

Merged
astar-development-jb merged 4 commits into
mainfrom
fix/di-serilog-ilogger-registration
Jun 27, 2026
Merged

fix: correct DI and config wiring so app starts cleanly#51
astar-development-jb merged 4 commits into
mainfrom
fix/di-serilog-ilogger-registration

Conversation

@jaybarden1

@jaybarden1 jaybarden1 commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Three bugs in App.axaml.cs that together prevented the app from starting:

  1. Wrong config section nameGetSection(nameof(ScrapeConfigModel)) resolved to "ScrapeConfigModel" (the using-alias name), not "ScrapeConfiguration". So IOptions<ScrapeConfiguration>.Value had all null sub-objects → NullReferenceException in DataSeed.Seed on first run against an empty DB.

  2. Wrong connection string keyGetConnectionString("Sqlite") reads from the root ConnectionStrings:Sqlite config key, which doesn't exist. The actual key is scrapeConfiguration:connectionStrings:sqlite (in user secrets). This caused UseSqlite(null) → context was "configured" but with no path → IsConfigured = trueOnConfiguring fallback skipped → missing-table errors.

  3. Serilog.ILogger not registered — Logger was registered only as the concrete Serilog.Core.Logger; ImportExportService requests Serilog.ILogger. Added an alias registration so both resolve from the same singleton.

Test plan

  • Build: 0 errors
  • 94 tests pass (39 FunctionalParadigm + 55 Unit)
  • App launched locally — ran 20 s with no exceptions; seeding logged and completed

🤖 Generated with Claude Code

jaybarden1 and others added 2 commits June 27, 2026 20:23
Tmds.DBus.Protocol 0.93.0 removed the Connection class that
Avalonia.X11 12.0.0 compiled against, causing a TypeLoadException
on Linux startup. Avalonia 12.0.5 ships with 0.92.0 which keeps the
Connection API and still fixes GHSA-xrw6-gwf8-vvr9. Also bumps
SkiaSharp from the preview (3.119.3-preview.1.1) to the stable
3.119.4 required by Avalonia.Skia 12.0.5.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tivation failure

App.axaml.cs registered the logger as the concrete Serilog.Core.Logger type
but ImportExportService takes Serilog.ILogger. Add an ILogger alias
registration that resolves via the existing Logger singleton.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jaybarden1 jaybarden1 requested a review from a team June 27, 2026 19:51
Three bugs in App.axaml.cs:
- GetSection(nameof(ScrapeConfigModel)) used the alias name "ScrapeConfigModel"
  not "ScrapeConfiguration", so IOptions<ScrapeConfiguration> always had null
  sub-objects, causing NullReferenceException in DataSeed on first run
- GetConnectionString("Sqlite") looked in the root ConnectionStrings section
  which is empty; connection string lives at
  scrapeConfiguration:connectionStrings:sqlite in user secrets
- Serilog.ILogger never registered (only Serilog.Core.Logger was), so
  ImportExportService failed to activate with InvalidOperationException

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jaybarden1 jaybarden1 changed the title fix: register Serilog.ILogger in DI to resolve app startup crash fix: correct DI and config wiring so app starts cleanly Jun 27, 2026
@astar-development-jb astar-development-jb enabled auto-merge (squash) June 27, 2026 20:08
@astar-development-jb astar-development-jb merged commit 6e20a0c into main Jun 27, 2026
6 checks passed
@astar-development-jb astar-development-jb deleted the fix/di-serilog-ilogger-registration branch June 27, 2026 20:11
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