fix: browser-log follow-ups from #47 (500 on unknown trail edit id, local avatars, map style warning, empty label for) #48

Merged
jmz merged 4 commits from fix/47-browser-log into deploy 2026-11-04 19:30:27 +00:00
Member

Browser-log follow-ups from #47 (Firefox, /trail/edit/new). The 504 itself was in trail-analyze and is fixed in jmz/homelab-flux#819. This PR has the app-side fixes. Each commit is self-contained.

# Log line Verdict Here
5 Source map error: request failed with status 500 … /trail/edit/<anonymous code>, installHook.js.map The probe comes from a devtools extension, but the 500 is ours. /trail/edit/[id] let trails_show's APIError escape (Error: Trail not found. in the pod log). fix(trail-edit): map APIError to error(status), the same as the trail view page. Unknown ids now get 404.
8 api.dicebear.com/7.x/initials/svg?seed=jmz Real (privacy). 26 call sites sent every displayed username, plus the viewer's IP, to DiceBear. fix(privacy): new avatar_util.initialsAvatar() builds an initials-on-gradient SVG data URI locally, with vitest tests.
2 There is no style added to the map. Ours. map.isStyleLoaded() warns when it is called before setStyle (4 call sites in the editor and map component). fix(map): isMapStyleLoaded(map) checks map.style first.
4 Empty string passed to getElementById() Mostly Firefox form-autofill. Our part: base fields default name="", which renders <label for="">. fix(forms): drop for/id when there is no name. If the line still appears afterwards, it is Firefox internals.
1 XML Parsing Error: syntax error … Line 1, Column 1 Upstream, harmless. [email protected] dist/lib/parser.js:12 parses the literal 'INVALID' at module load to detect the parsererror namespace. Firefox logs every failing DOMParser parse with the document URL. No fix. Removing it would mean replacing the dependency.
3 Error in parsing value for 'user-select: undefined' Upstream, harmless. maplibre-gl 6.11.1 src/util/dom.ts:90-92 DOM.enableDrag() restores a saved userSelect that is still undefined when disableDrag() never ran. Firefox drops the declaration. No fix (upstream).
6 may not load or link to file:/// Extension noise. No file:// reference exists in the app. It comes with the devtools installHook.js source map. None.
7 GET /trail/edit/new 304 Expected. SvelteKit sets an ETag on SSR HTML and answers a matching If-None-Match with 304 after rendering. The page is still rendered on every request, so nothing is served stale. None.
9 -moz-column-gap, -webkit-text-size-adjust, ::-moz-focus-inner Noise. These are vendor prefixes from Tailwind/lightningcss (gap-x-*), Tailwind preflight, and maplibre-gl.css (.maplibregl-ctrl button::-moz-focus-inner). None.

Deploy: after merge, an image build (image.yml, ref=deploy, web) and a digest bump in homelab-flux apps/wanderer/wanderer.yaml.

Refs #47

🤖 Generated with Claude Code

https://claude.ai/code/session_01XMf4EKNjKMd6bwCpS7K4jU

Browser-log follow-ups from #47 (Firefox, `/trail/edit/new`). The 504 itself was in trail-analyze and is fixed in jmz/homelab-flux#819. This PR has the app-side fixes. Each commit is self-contained. | # | Log line | Verdict | Here | |---|---|---|---| | 5 | `Source map error: request failed with status 500 … /trail/edit/<anonymous code>`, `installHook.js.map` | The probe comes from a devtools extension, but **the 500 is ours**. `/trail/edit/[id]` let `trails_show`'s APIError escape (`Error: Trail not found.` in the pod log). | `fix(trail-edit)`: map APIError to `error(status)`, the same as the trail view page. Unknown ids now get 404. | | 8 | `api.dicebear.com/7.x/initials/svg?seed=jmz` | **Real (privacy).** 26 call sites sent every displayed username, plus the viewer's IP, to DiceBear. | `fix(privacy)`: new `avatar_util.initialsAvatar()` builds an initials-on-gradient SVG data URI locally, with vitest tests. | | 2 | `There is no style added to the map.` | **Ours.** `map.isStyleLoaded()` warns when it is called before `setStyle` (4 call sites in the editor and map component). | `fix(map)`: `isMapStyleLoaded(map)` checks `map.style` first. | | 4 | `Empty string passed to getElementById()` | **Mostly Firefox form-autofill.** Our part: base fields default `name=""`, which renders `<label for="">`. | `fix(forms)`: drop `for`/`id` when there is no name. If the line still appears afterwards, it is Firefox internals. | | 1 | `XML Parsing Error: syntax error … Line 1, Column 1` | **Upstream, harmless.** `[email protected]` `dist/lib/parser.js:12` parses the literal `'INVALID'` at module load to detect the parsererror namespace. Firefox logs every failing DOMParser parse with the document URL. | No fix. Removing it would mean replacing the dependency. | | 3 | `Error in parsing value for 'user-select: undefined'` | **Upstream, harmless.** maplibre-gl 6.11.1 `src/util/dom.ts:90-92` `DOM.enableDrag()` restores a saved `userSelect` that is still `undefined` when `disableDrag()` never ran. Firefox drops the declaration. | No fix (upstream). | | 6 | `may not load or link to file:///` | **Extension noise.** No `file://` reference exists in the app. It comes with the devtools `installHook.js` source map. | None. | | 7 | `GET /trail/edit/new 304` | **Expected.** SvelteKit sets an ETag on SSR HTML and answers a matching `If-None-Match` with 304 after rendering. The page is still rendered on every request, so nothing is served stale. | None. | | 9 | `-moz-column-gap`, `-webkit-text-size-adjust`, `::-moz-focus-inner` | **Noise.** These are vendor prefixes from Tailwind/lightningcss (`gap-x-*`), Tailwind preflight, and `maplibre-gl.css` (`.maplibregl-ctrl button::-moz-focus-inner`). | None. | Deploy: after merge, an image build (`image.yml`, `ref=deploy`, web) and a digest bump in homelab-flux `apps/wanderer/wanderer.yaml`. Refs #47 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01XMf4EKNjKMd6bwCpS7K4jU
trails_show throws an APIError for an unknown or inaccessible id; the
edit page's load let it escape, so SvelteKit rendered a 500. That is
also what a devtools extension's source-map probe hit
(/trail/edit/installHook.js.map). Map it to error(status) like the
trail view page does.

Refs #47

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XMf4EKNjKMd6bwCpS7K4jU
Every actor without a picture was rendered from
https://api.dicebear.com/7.x/initials/svg?seed=<username>, sending each
displayed username and the viewer's IP to a third party (and failing
offline). Generate the initials-on-gradient SVG in the browser as a
data URI instead (avatar_util.initialsAvatar).

Refs #47

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XMf4EKNjKMd6bwCpS7K4jU
map.isStyleLoaded() logs "There is no style added to the map." when it
runs before setStyle (reactive effects firing while the map initialises).
isMapStyleLoaded checks map.style first.

Refs #47

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XMf4EKNjKMd6bwCpS7K4jU
fix(forms): omit label for/id when a field has no name
All checks were successful
CI / go (push) Successful in 10m39s
CI / web (push) Successful in 51s
e72a2cc5dc
Base fields default name to "", so a labelled field without a name
rendered <label for="">, which makes Firefox's form autofill call
getElementById("") ("Empty string passed to getElementById()").

Refs #47

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XMf4EKNjKMd6bwCpS7K4jU
jmz merged commit e72a2cc5dc into deploy 2026-11-04 19:30:27 +00:00
jmz deleted branch fix/47-browser-log 2026-11-04 19:30:27 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
public/wanderer!48
No description provided.