firstsun-dev_git-files-sync/tests
ClaudiaFang a86721752a fix: surface a clear error when requestUrl() itself rejects with HTML content
parseJson() already handles the case where a response resolves normally
but its .json getter throws on an HTML body (e.g. a login/SSO redirect
or proxy error page). But some Obsidian versions eagerly parse the
response body as JSON inside requestUrl() itself, so the same failure
can instead reject the whole call with a raw SyntaxError — landing in
safeRequest's outer catch, before there's even a response object to
inspect. That catch just rethrew the error verbatim, surfacing the
literal "Unexpected token '<', \"<!DOCTYPE \"... is not valid JSON"
message to the user (as seen in the reported "Failed to refresh" case,
against a self-hosted GitLab instance).

safeRequest's outer catch now recognizes this error's known V8
phrasings and throws the same friendly "received an HTML page" message
parseJson() already produces for the other code path.

Closes #31
2026-07-13 13:46:38 +00:00
..
logic fix(sync): stop false-positive rename detection and 422 on rename push 2026-07-05 05:44:54 +00:00
services fix: surface a clear error when requestUrl() itself rejects with HTML content 2026-07-13 13:46:38 +00:00
ui fix(compat): support Obsidian down to 1.11.0 2026-07-07 01:53:28 +00:00
utils refactor(test): eliminate duplicate code flagged by SonarCloud 2026-05-22 03:52:32 +00:00
setup.ts refactor(ui): unify Sync Status icons via Lucide setIcon 2026-06-26 06:22:53 +00:00