Skip to content

fix(widget): proof-of-delivery widget requests int/v1/proofs/recent - #407

Merged
roncodes merged 1 commit into
release/v0.6.73from
fix/proof-of-delivery-widget-path
Oct 15, 2026
Merged

roncodes merged 1 commit into
release/v0.6.73from
fix/proof-of-delivery-widget-path

Conversation

@roncodes

Copy link
Copy Markdown
Member

Root cause

The proof-of-delivery dashboard widget always showed "There is nothing to see here" because its request 404'd. addon/components/widget/proof-of-delivery.js called this.fetch.get('fleet-ops/proofs/recent', …). The fetch service's default namespace is int/v1, so that went to /int/v1/fleet-ops/proofs/recent.

The route added in #388 is registered with fleetbaseRoutes('proofs', …) in the main internal v1 group in server/src/routes.php, not inside the nested fleet-ops prefix group. It is served at /int/v1/proofs/recent.

The unit test stubbed fetch.get and asserted the same wrong path string, so it passed while the real request failed.

Fix

  • The widget now requests proofs/recent with the default namespace, matching the other fleetbaseRoutes resources in that group (for example orders, positions, devices). None of those calls pass a namespace option.
  • The widget's unit test stub now records the full URL the fetch service would request (namespace option, defaulting to the console's int/v1, plus path and query string). The test asserts GET int/v1/proofs/recent?limit=12, which is what php artisan route:list reports for this route. With the old path, the test records int/v1/fleet-ops/proofs/recent and fails.

Audit of other fleet-ops/… calls

I checked all ~234 literal this.fetch.<verb>('…') paths in addon/ against the live route:list, resolving each call's namespace option. I found no other call where a fleet-ops/ prefix was added or dropped by mistake. Every fleet-ops/… call resolves to a route in the nested fleet-ops group (live, lookup, settings, metrics, analytics, hubs, radar, orchestrator, manifests, …).

Two calls hit no route, but they are a different problem, so this PR leaves them alone:

  • addon/components/customer/orders.js (cancelOrder, saveDeliveryInstructions) posts to customer-portal/orders/{id}/… with namespace fleet-ops/int/v1. No such route exists under any prefix, and the customer portal extension serves customer-portal/int/v1/… without a cancel or delivery-instructions endpoint.
  • addon/services/driver-scheduling.js checkAvailability gets schedule-availability/check. No route is registered, and nothing in the addon calls checkAvailability.

Verification

  • curl on the local stack (API localhost:8000):
    • Without auth: /int/v1/proofs/recent → 401 and /int/v1/fleet-ops/proofs/recent → 404.
    • With a Sanctum token: /int/v1/proofs/recent?limit=12 → 200 {"proofs": []} (the local company has no proof photos) and /int/v1/fleet-ops/proofs/recent → 404.
  • ember test --filter "widget/proof-of-delivery" (headless Chrome): 8/8 pass in Chrome 155. The testem runner did not exit after reporting, so I stopped it after all 8 results were in.
  • eslint and prettier are clean on both changed files.
  • Not checked in the console UI: the local console builds from a different fleetops checkout, so the tile was verified only through the API and the unit test.

The recent-proofs route is registered as a fleetbaseRoutes('proofs') resource in
the main internal v1 group, not under the fleet-ops prefix, so the widget's
fleet-ops/proofs/recent request 404'd and the tile always showed its empty state.

The unit test now records the full URL (namespace + path + query) the fetch
service would request and asserts GET int/v1/proofs/recent?limit=12.

Co-Authored-By: Claude <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (3b4ba17) to head (6cedb25).
⚠️ Report is 4 commits behind head on release/v0.6.73.

Additional details and impacted files
@@                 Coverage Diff                 @@
##             release/v0.6.73      #407   +/-   ##
===================================================
  Coverage             100.00%   100.00%           
- Complexity             13585     13591    +6     
===================================================
  Files                    634       634           
  Lines                  49308     49331   +23     
===================================================
+ Hits                   49308     49331   +23     
Flag Coverage Δ
backend 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@roncodes
roncodes merged commit 88ac727 into release/v0.6.73 Oct 15, 2026
8 checks passed
@roncodes
roncodes deleted the fix/proof-of-delivery-widget-path branch October 15, 2026 08:40
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.

1 participant