Skip to content

fix: debug log file mismatch and missing http warning entries in debug log#182

Open
Vinyl-Davyl wants to merge 2 commits intoNetflix:masterfrom
Vinyl-Davyl:fix-debug-log-filename-mismatch--and-missing-HTTP-warning-entries-in-debug-log
Open

fix: debug log file mismatch and missing http warning entries in debug log#182
Vinyl-Davyl wants to merge 2 commits intoNetflix:masterfrom
Vinyl-Davyl:fix-debug-log-filename-mismatch--and-missing-HTTP-warning-entries-in-debug-log

Conversation

@Vinyl-Davyl
Copy link
Copy Markdown

@Vinyl-Davyl Vinyl-Davyl commented Mar 17, 2026

Requirements for a pull request

  • Unit tests related to the change have been updated
  • Documentation related to the change has been updated

Description of the Change

Addresses Issue #181
Fixes two defects in the debug logging infrastructure across two small utility files:

1. src/utils/debugdb.ts — Malformed log filename
A double-closing-brace typo (}}) in the getLogs() template literal caused
every downloaded debug log to have a spurious } appended to its filename
(e.g. logs-2025-01-01T00:00:00.000Z}.txt). This is corrected to produce the
intended logs-<ISO timestamp>.txt.

2. src/utils/errorlogger.ts — HTTP warnings not persisted to debug log
logWarning is called by useResource on every HTTP error, but previously only
invoked console.warn. It did not call setLogItem, so warnings were invisible
in downloaded crash reports. This change routes all warnings into the IndexedDB
debug log and restores version environment prefixing on the console output
(the getVersionInfo import was already present but commented out).

Alternate Designs

An alternative would be to update every logWarning call site to also call
setLogItem directly. This was ruled out because it would scatter logging
boilerplate across multiple files and violate the single-responsibility principle
of the errorlogger module. Centralising the behaviour in one place is cleaner
and ensures any future callers automatically benefit.

Possible Drawbacks

  • logWarning now has a dependency on debugdb. If debug logging is not
    initialised (i.e. startLogging() has not been called), setLogItem is a
    no-op, so there is no runtime error — warnings are simply not persisted, which
    is the existing behaviour.
  • Negligible: one additional async IndexedDB write per HTTP warning, which only
    occurs in the debug-mode code path.

Verification Process

  1. Run project.
  2. Open the debug panel and enable logging.
  3. Navigate to a non-existent run to trigger a 404 HTTP error.
  4. Download the debug log.
  5. Confirm the downloaded filename has no trailing } character.
  6. Open the .txt file and confirm WARN HTTP error id: not-found is present.

Release Notes

Fixed a bug where downloaded debug log files had a malformed filename ending in
}. HTTP warning messages are now also captured in the debug log, making
downloaded crash reports more complete. Fixes #181

@Vinyl-Davyl
Copy link
Copy Markdown
Author

Vinyl-Davyl commented Mar 17, 2026

cc: @saikonen @romain-intel

@Vinyl-Davyl Vinyl-Davyl changed the title fix: debug log filename mismatch and missing http warning entries in debug log fix: debug log file mismatch and missing http warning entries in debug log Mar 17, 2026
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.

Debug log download produces malformed filename and omits HTTP warning entries

1 participant