-
Notifications
You must be signed in to change notification settings - Fork 222
Open
Description
Problem Description
When a DUT ID contains the # character (e.g., BOARD#123), the web GUI history feature fails to retrieve the correct test record. The # is interpreted by the browser as a URL fragment identifier, truncating the query parameter.
Steps to Reproduce
- Run an OpenHTF test with a DUT ID containing
#(e.g.,PCB#001) - Open the station server web GUI
- View the History panel
- Click on a history item to load it
- If the item was created via
prependItemFromTestState, theretrieveFileNamecall will fail
Root Cause
In openhtf/output/web_gui/src/app/stations/station/history.service.ts lines 163-165:
const url =
(`${baseUrl}/history?dutId=${historyItem.dutId}` +
`&startTimeMillis=${historyItem.startTimeMillis}`);The dutId is interpolated directly into the URL without encodeURIComponent().
When dutId is BOARD#123:
- URL becomes:
/history?dutId=BOARD#123&startTimeMillis=... - Browser interprets
#123&startTimeMillis=...as a fragment (anchor) - Only
/history?dutId=BOARDis sent to the server - Server receives incomplete
dutId, returning no matching history items
Other Affected Characters
This bug affects any DUT ID containing URL-reserved characters: #, &, =, ?, %, +, spaces, etc.
Proposed Fix
const url =
(`${baseUrl}/history?dutId=${encodeURIComponent(historyItem.dutId)}` +
`&startTimeMillis=${historyItem.startTimeMillis}`);Alternatively, Angular's HttpClient can handle parameter encoding automatically:
return this.http.get<RawHistoryItemList>(url, {
params: {
dutId: historyItem.dutId,
startTimeMillis: String(historyItem.startTimeMillis)
}
}).toPromise();Environment
- OpenHTF version: latest (master branch)
- Browser: Any (Chrome, Firefox, Safari)
- File:
openhtf/output/web_gui/src/app/stations/station/history.service.ts
Metadata
Metadata
Assignees
Labels
No labels