Skip to content

Report missing objects to server when not found in online index#222

Merged
LeftofZen merged 3 commits intomasterfrom
copilot/add-missing-objects-functionality
Dec 28, 2025
Merged

Report missing objects to server when not found in online index#222
LeftofZen merged 3 commits intomasterfrom
copilot/add-missing-objects-functionality

Conversation

Copy link
Contributor

Copilot AI commented Dec 27, 2025

When downloading missing objects for a scenario, the editor now reports objects not found in the online index to the server's missing objects registry.

Changes

Client layer (Definitions/Web/Client.cs)

  • Added AddMissingObjectAsync to POST DtoMissingObjectEntry to /missing endpoint

GUI client wrapper (Gui/ObjectServiceClient.cs)

  • Exposed AddMissingObjectAsync method

Scenario view model (Gui/ViewModels/LocoTypes/SCV5ViewModel.cs)

  • Modified DownloadMissingObjects() to report objects not found in online index:
if (onlineObj == null)
{
    var missingEntry = new DtoMissingObjectEntry(
        obj.Name, obj.Checksum, obj.ObjectType.Convert());
    
    var added = await Model.ObjectServiceClient.AddMissingObjectAsync(missingEntry);
    // Log result and continue
}

Tests (Tests/ObjectServiceIntegrationTests/ObjectRoutesTest.cs)

  • Added integration test verifying missing objects are created in database with ObjectAvailability.Missing status

The server-side /missing endpoint (AddMissingObject in ObjectRouteHandler.cs) was already implemented.

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
    • Triggering command: /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)
    • Triggering command: /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 .cs ctService ndor/bin/git (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Allow editor to add to missing objects</issue_title>
<issue_description>This would happen if the user of the editor runs the 'find objects in service for scenario' and the server indicates some are missing. The editor can then request that those are missing and to add them</issue_description>

<agent_instructions>The ObjectService project is where the web server is. It already has a route /missing for checking missing objects (ListMissing) and adding addition ones to the database (AddMissing), as well as the DtoMissingObjectEntry record. What needs to happen is in the editor (Gui project), specifically in the DownloadMissingObjects() method, if there is no matching object found in the online index, then we send a post request to the server with the details about the missing object via a new DtoMissingObjectEntry</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: LeftofZen <7483209+LeftofZen@users.noreply.github.com>
Copilot AI changed the title [WIP] Add functionality to allow editor to add missing objects Report missing objects to server when not found in online index Dec 27, 2025
Copilot AI requested a review from LeftofZen December 27, 2025 14:08
@LeftofZen LeftofZen force-pushed the copilot/add-missing-objects-functionality branch from 27018ef to 21b622f Compare December 28, 2025 00:48
@LeftofZen LeftofZen marked this pull request as ready for review December 28, 2025 00:48
Copilot AI review requested due to automatic review settings December 28, 2025 00:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds functionality for the ObjectEditor to report objects that are not found in the online index to the server's missing objects registry. When users attempt to download missing objects for a scenario and the server indicates some are not available, the editor now automatically reports these to the server for tracking purposes.

Key Changes

  • Implemented client-side method to POST missing object entries to the server
  • Enhanced scenario download workflow to report unfound objects
  • Added integration test to verify missing objects are properly recorded in the database

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Definitions/Web/Client.cs Added AddMissingObjectAsync method to POST missing object entries to the /missing endpoint
Gui/ObjectServiceClient.cs Exposed the AddMissingObjectAsync method for GUI layer consumption
Gui/ViewModels/LocoTypes/SCV5ViewModel.cs Modified DownloadMissingObjects to report objects not found in online index and improved error logging with contextual information
Tests/ObjectServiceIntegrationTests/ObjectRoutesTest.cs Added integration test AddMissingObjectAsync that verifies missing objects are created with correct availability status
Tests/ObjectServiceIntegrationTests/BaseReferenceDataTableTestFixture.cs Refactored GetDbContext helper method to reduce code duplication in test setup

@LeftofZen LeftofZen merged commit 547ebf3 into master Dec 28, 2025
6 checks passed
@LeftofZen LeftofZen deleted the copilot/add-missing-objects-functionality branch December 28, 2025 00:53
@LeftofZen LeftofZen added this to the 5.7.0 milestone Dec 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow editor to add to missing objects

2 participants