Cache DNS answers and paint saved people before launch revalidation
Some checks failed
review/security-claude BLOCK: DnsConnectionRetry crashes app on Jellyfin WebSocket (NoSuchElementException)

This commit is contained in:
justinzeus 2026-11-07 00:09:57 +01:00
parent f4fb6e22c9
commit 327f631f0d
18 changed files with 763 additions and 44 deletions

View file

@ -27,6 +27,44 @@ Upstream enables JVM unit tests only for debug variants; there is no
`testDefaultReleaseUnitTest` task. `make test` uses the closest default-flavor
task without changing upstream's test configuration.
## Saved-person launch and DNS
Launch restores an unprotected saved Jellyfin login from local storage before
network validation. The existing Wolfskin picker paints the saved names and
identity-derived colors, then refreshes the household in the background. PIN and
require-login profiles still go through the existing protected sign-in flow.
`Users/Me` and `System/Info/Public` now start concurrently; a late launch response
cannot replace a different selected person.
Jellyfin, Conductarr, artwork, playback and crash-report clients share one
`PersistentDns` instance through the application graph. It keeps system-ordered
IPv6/IPv4 answers in memory and `filesDir/wolfskin-dns.json` (at most 32 hosts).
Saved answers return immediately for up to 24 hours and refresh off main after
60 seconds; failed background lookups back off for 2 seconds without extending
the last successful timestamp. Negative answers are not persisted or cached.
Missing, oversized or corrupt hint files fall back to system resolution.
Application creation warms the saved Jellyfin host and configured Conductarr
host on parallel IO jobs; it does not change Android Private DNS.
A connection-establishment failure before any HTTP request headers were sent
gets one fresh system lookup and one retry. Responses, read failures and
uncertain mutation outcomes are not replayed. Conductarr retains its existing
no-automatic-replay policy after a request starts. A DNS refresh changes the next
new connection; already-working pooled connections are not forcibly closed.
Device acceptance (not established by JVM tests): with saved people present,
cold-launch six times more than 60 seconds apart and require the picker within
0.5 seconds on every launch. Press Left/Right then one OK; the selected Home must
open without a second picker. Open the avatar picker, change person with one OK,
and repeat after an offline launch to confirm saved people still paint.
Compare timestamps of the launch pair of SDK log lines
`GET https://jelly.justinvisser.org/Users/Me` and
`GET https://jelly.justinvisser.org/System/Info/Public` (ignore later foreground
`Users/Me` refreshes). The spike's two slow launch gaps were 1.508 and 1.509
seconds. The requests now overlap, so either may log first; the picker must not
wait for either response. The minified SDK log tag is not stable across builds.
## Optimized side-by-side comparison
The `optimized` build type inherits `release`: R8 optimization/minification,