Skip to content

fix(service-rate): resolve parcel box images after production fingerprinting - #370

Merged
roncodes merged 1 commit into
release/v0.6.72from
fix/parcel-box-image-fingerprint
Oct 7, 2026
Merged

roncodes merged 1 commit into
release/v0.6.72from
fix/parcel-box-image-fingerprint

Conversation

@roncodes

@roncodes roncodes commented Oct 7, 2026

Copy link
Copy Markdown
Member

Problem

In the published console (fleetbase/fleetbase-console:v0.7.68), the parcel fee section of the service rate form and details panel shows broken images. /engines-dist/images/boxes/small.png returns the console's index.html (HTTP 200, text/html).

Cause

The asset path itself is correct. Because the engine is lazy, ember-engines moves its public tree under engines-dist/, and mergeWithPublicTree puts assets/ at the root of that tree, so the boxes really do land in engines-dist/images/boxes/.

The problem is fingerprinting. The console's production build runs broccoli-asset-rev, which fingerprints png, jpg, gif, js, css and map by default. The v0.7.68 image ships:

engines-dist/images/boxes/small-8bb1ab261f579043d455f1cb6a528edf.png
engines-dist/images/boxes/medium-5e0db208f3a521346e027eeaa1f84201.png
engines-dist/images/boxes/large-8733258016b7bf680507fc30b428353f.png
engines-dist/images/boxes/x-large-74c83d1fd2796caea1f6970a8bfec85a.png

broccoli-asset-rev rewrites asset URLs that appear as literal strings in JS, CSS and HTML. It can't rewrite /engines-dist/images/boxes/{{parcelFee.size}}.png because the file name is only built at runtime. The shipped engine.js still contains the bare /engines-dist/images/boxes/ prefix, so the request misses and nginx's SPA fallback serves index.html.

Fix

A new parcel-box-image helper maps each size to a literal URL, so the fingerprinter rewrites each one to its hashed name. Unknown sizes fall back to the medium box. Both service-rate/form.hbs and service-rate/details.hbs use it.

Other /engines-dist/images/... references

I checked these against the shipped v0.7.68 engine.js and engine.css. None needs a change:

Reference In the published build
map-marker.png (widget/live-fleet.hbs) Literal string, rewritten to map-marker-bfdcdde0….png
building-marker.png (several) Literal string, rewritten to building-marker-aa16d468….png
drawing-controls-spritesheet-inverted.png (fleetops-engine.css) Literal url(), rewritten to its hashed name
drawing-controls-spritesheet.svg (fleetops-engine.css) svg isn't fingerprinted, served as is
telematics/providers/default.webp (resource-descriptors/connectivity.js) webp isn't fingerprinted, served as is

Unrelated, but found during the audit: map/google-live-map.js falls back to /engines-dist/images/driver-marker.png and /engines-dist/images/vehicle-marker.png. Neither file exists in this package or in the published image, so those fallbacks are broken in every build. This PR leaves them alone.

Testing

I didn't run a local build. CI covers the new integration test (tests/integration/helpers/parcel-box-image-test.js). The fingerprint rewrite only happens in a production console build, so the end-to-end check is a showcase capture without the capture/fixtures/boxes override.

…rinting

Production console builds fingerprint .png files, so boxes/small.png ships
as boxes/small-<hash>.png. broccoli-asset-rev rewrites literal asset URLs to
the hashed names, but it cannot rewrite the interpolated
/engines-dist/images/boxes/{{parcelFee.size}}.png, so the request misses and
the server answers with index.html.

Add a parcel-box-image helper that maps each size to a literal URL the
fingerprinter can rewrite, and use it in the service rate form and details.
@codecov

codecov Bot commented Oct 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (9ba5d0d) to head (c255ee6).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##                main      #370   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity     12379     12379           
===========================================
  Files            600       600           
  Lines          46496     46496           
===========================================
  Hits           46496     46496           
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 changed the base branch from main to release/v0.6.72 October 7, 2026 05:59
@roncodes roncodes mentioned this pull request Oct 7, 2026
@roncodes
roncodes merged commit 94fe401 into release/v0.6.72 Oct 7, 2026
11 checks passed
@roncodes
roncodes deleted the fix/parcel-box-image-fingerprint branch October 7, 2026 06:07
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