Conversation
Co-authored-by: LeftofZen <7483209+LeftofZen@users.noreply.github.com>
Co-authored-by: LeftofZen <7483209+LeftofZen@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add TblObjectMissing table design and update handler
Migrate missing objects from ObjectAvailability enum to dedicated TblObjectMissing table
Dec 28, 2025
Contributor
There was a problem hiding this comment.
Pull request overview
This PR successfully migrates missing objects from being stored as TblObject records with Availability = ObjectAvailability.Missing to a dedicated TblObjectMissing table, simplifying the data model and improving separation of concerns.
Key changes:
- Created new
TblObjectMissingtable with fields forDatName,DatChecksum, andObjectType, with a unique composite index - Introduced new DTOs:
DtoObjectMissingEntry(with Id) andDtoObjectMissingUpload(without Id), replacing the formerDtoMissingObjectEntry - Updated
ObjectMissingRouteHandlerto operate directly on the newObjectsMissingtable - Modified
ObjectRouteHandlerto check for and remove stale missing entries when actual objects are uploaded - Added comprehensive integration tests for the missing objects routes
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Definitions/Database/DataTables/TblObjectMissing.cs | Defines new table class with composite unique index on DatName and DatChecksum |
| Definitions/Database/LocoDbContext.cs | Registers ObjectsMissing DbSet |
| Definitions/Migrations/20251228122835_AddTblObjectMissing.cs | EF Core migration creating ObjectsMissing table (also includes unrelated schema changes) |
| Definitions/DTO/DtoObjectMissingEntry.cs | New DTO for missing objects with Id field |
| Definitions/DTO/DtoObjectMissingUpload.cs | Renamed from DtoMissingObjectEntry, used for POST requests |
| Definitions/DTO/Mappers/DtoExtensions.cs | Added mapping methods between TblObjectMissing and DTOs |
| Definitions/DTO/Comparers/*.cs | Updated comparers for renamed/new DTO types |
| ObjectService/RouteHandlers/TableHandlers/ObjectMissingRouteHandler.cs | Completely rewritten to use ObjectsMissing table instead of filtering Objects |
| ObjectService/RouteHandlers/TableHandlers/ObjectRouteHandler.cs | Checks and removes missing entries when actual object is uploaded |
| Gui/ObjectServiceClient.cs | Updated return type to DtoObjectMissingEntry for AddMissingObjectAsync |
| Gui/ViewModels/LocoTypes/SCV5ViewModel.cs | Updated to use new DTO types and improved logging format |
| Definitions/Web/Client.cs | Updated AddMissingObjectAsync signature to return DtoObjectMissingEntry |
| Tests/ObjectServiceIntegrationTests/ObjectMissingRoutesTest.cs | New comprehensive integration tests for missing objects CRUD operations |
| Tests/ObjectServiceIntegrationTests/ObjectRoutesTest.cs | Removed obsolete AddMissingObjectAsync test |
Files not reviewed (1)
- Definitions/Migrations/20251228122835_AddTblObjectMissing.Designer.cs: Language not supported
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.
Missing objects were stored as
TblObjectrecords withAvailability = ObjectAvailability.Missing, mixing database storage concerns with availability states. This moves them to a dedicatedTblObjectMissingtable.Changes
New table structure:
TblObjectMissingwith fields fromDtoMissingObjectEntry:DatName,DatChecksum,ObjectType(DatName, DatChecksum)DbSet<TblObjectMissing> MissingObjectsinLocoDbContextRoute handler updates:
ObjectMissingRouteHandler: Now operates directly onMissingObjectstable instead of filteringTblObjectObjectRouteHandler: ChecksMissingObjectson upload and removes stale entries when actual object is providedBefore:
After:
Includes EF Core migration and updated tests. The
ObjectAvailability.Missingenum value remains for potential future use but is no longer referenced in the codebase.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
av-build-tel-api-v1.avaloniaui.net/usr/share/dotnet/dotnet dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.1/tools/netstandard2.0/runtimeconfig.json /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.1/tools/netstandard2.0/Avalonia.BuildServices.Collector.dll(dns block)/usr/share/dotnet/dotnet dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.1/tools/netstandard2.0/runtimeconfig.json /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.1/tools/netstandard2.0/Avalonia.BuildServices.Collector.dll sharp/working/emptyFakeDotnetRoot 01CD7828DF338951F5/missingpackages_workingdir(dns block)/usr/share/dotnet/dotnet dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.2/tools/netstandard2.0/runtimeconfig.json /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.2/tools/netstandard2.0/Avalonia.BuildServices.Collector.dll get.config(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.