Skip to content

Refactor missing object routes to use BaseTableRouteHandler pattern#224

Merged
LeftofZen merged 11 commits intomasterfrom
copilot/add-object-missing-route-handler
Dec 28, 2025
Merged

Refactor missing object routes to use BaseTableRouteHandler pattern#224
LeftofZen merged 11 commits intomasterfrom
copilot/add-object-missing-route-handler

Conversation

Copy link
Contributor

Copilot AI commented Dec 28, 2025

The /objects/missing routes were manually mapped in ObjectRouteHandler.MapAdditionalRoutes() instead of following the ITableRouteHandler pattern used by other route handlers.

Changes

  • Created ObjectMissingRouteHandler

    • Implements ITableRouteHandler with BaseRoute = "/missing"
    • Migrated ListMissingObjects and AddMissingObject methods from ObjectRouteHandler
    • Added stub implementations for Read/Update/Delete returning 501 Not Implemented
  • Updated ObjectRouteHandler.MapAdditionalRoutes

    • Replaced manual MapGet/MapPost calls with BaseTableRouteHandler.MapRoutes<ObjectMissingRouteHandler>(parentRoute)
    • Removed migrated methods

Example

Before:

public static void MapAdditionalRoutes(IEndpointRouteBuilder parentRoute)
{
    _ = parentRoute.MapGet(RoutesV2.Missing, ListMissingObjects);
    _ = parentRoute.MapPost(RoutesV2.Missing, AddMissingObject);
    // ... other routes
}

After:

public static void MapAdditionalRoutes(IEndpointRouteBuilder parentRoute)
{
    BaseTableRouteHandler.MapRoutes<ObjectMissingRouteHandler>(parentRoute);
    // ... other routes
}

API routes unchanged: GET/POST /v2/objects/missing

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.2/tools/netstandard2.0/runtimeconfig.json /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.2/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 rs/ObjectMissingRouteHandler.cs ctService/RouteH--logger:console;verbosity=normal ctService/RouteH/home/REDACTED/work/ObjectEditor/ObjectEditor/Tests/bin/Release/net10.0/Tests.dll ctService/RouteHbash ctService/RouteH--norc ctService/RouteH--noprofile ctService/RouteHandlers/TableHan/nologo ctSe�� ctService/RouteHandlers/TableHan/nodeReuse:true /netstandard2.0/runtimeconfig.json /netstandard2.0/Avalonia.BuildServices.Collector.dll ctService/RouteHbash ctService/RouteH--norc ctService/RouteH--noprofile ctService/RouteHandlers/BaseData/nologo (dns block)

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

Original prompt

in ObjectRouteHandler.cs, there are 2 additional routes added for Missing, which will resolve to "/objects/missing". Instead of adding these manually, we should create a full route handler class for it (called "ObjectMissingRouteHandler") that implements ITableRouteHandler as per the other route handlers, and then in ObjectRouteHandler we can reuse the BaseTableRouteHandler.MapRoutes method with BaseTableRouteHandler.MapRoutes<ObjectMissingRouteHandler>(parentRoute).


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

Copilot AI and others added 5 commits December 28, 2025 01:13
…ler.MapRoutes

Co-authored-by: LeftofZen <7483209+LeftofZen@users.noreply.github.com>
…emove redundant MapRoutes

Co-authored-by: LeftofZen <7483209+LeftofZen@users.noreply.github.com>
Co-authored-by: LeftofZen <7483209+LeftofZen@users.noreply.github.com>
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 ObjectMissingRouteHandler for missing routes Refactor missing object routes to use BaseTableRouteHandler pattern Dec 28, 2025
Copilot AI requested a review from LeftofZen December 28, 2025 01:27
@LeftofZen LeftofZen force-pushed the copilot/add-object-missing-route-handler branch from f9d3e2d to a78710b Compare December 28, 2025 12:09
@LeftofZen LeftofZen marked this pull request as ready for review December 28, 2025 12:10
Copilot AI review requested due to automatic review settings December 28, 2025 12:10
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 refactors the missing object routes (/v2/objects/missing) to use the ITableRouteHandler pattern instead of manual route mapping, improving consistency with other route handlers in the codebase.

Key Changes:

  • Created ObjectMissingRouteHandler implementing ITableRouteHandler with full CRUD operations
  • Migrated ListMissingObjects and AddMissingObject from ObjectRouteHandler to the new handler
  • Added implementations for Read and Delete operations; Update returns 501 Not Implemented
  • Created DtoMissingObjectEntryComparer for comparing missing object entries

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
ObjectService/RouteHandlers/TableHandlers/ObjectMissingRouteHandler.cs New route handler implementing ITableRouteHandler pattern for missing objects with List, Create, Read, Update (stub), and Delete operations
ObjectService/RouteHandlers/TableHandlers/ObjectRouteHandler.cs Removed manual route mapping for missing objects and replaced with BaseTableRouteHandler.MapRoutes call
Definitions/DTO/Comparers/DtoMissingObjectEntryComparer.cs New comparer for DtoMissingObjectEntry based on DatName, DatChecksum, and ObjectType
Tests/ObjectServiceIntegrationTests/ObjectMissingRoutesTest.cs Stub test file with TODO for future test implementation

LeftofZen and others added 3 commits December 28, 2025 23:17
@LeftofZen LeftofZen merged commit 7fdcdd4 into master Dec 28, 2025
@LeftofZen LeftofZen deleted the copilot/add-object-missing-route-handler branch December 28, 2025 12:19
@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.

2 participants