fix(ui): stop false-positive conflict dialog for pages with no local edit - #321
Conversation
checkAndShowPendingConflict only skipped the dialog when previousContent exactly matched diskContent. When an off-page host-directory change introduces a brand-new page the browser never had, previousContent is blank instead — there's no local edit to protect, but the check didn't catch that case and surfaced a spurious conflict dialog. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
JVM Load Benchmark (Desktop)Synthetic in-memory benchmark measuring load performance for the desktop (JVM) app.
Flamegraphs (this PR)**Allocation** — object allocation pressure (JDBC/SQLite churn)Alloc flamegraph not available CPU — method-level hotspots by on-CPU time CPU flamegraph not available Top allocation hotspots (this PR)`38.7%` byte[]_[k] `6.8%` java.lang.String_[k] `6.1%` int[]_[k] `4.9%` java.lang.Object[]_[k] `4.9%` java.util.LinkedHashMap$Entry_[k]Top CPU hotspots (this PR)`96.5%` /usr/lib/x86_64-linux-gnu/libc.so.6 `1.2%` /tmp/sqlite-3.51.3.0-f52abb5b-428c-4d39-bd60-f6debcf7c371-libsqlitejdbc.so `0.5%` __libc_pwrite `0.3%` fsync `0.2%` SR_handler |
…block previousContent.isBlank() only inspects the page's first block. A page with a blank root block (e.g. a spacer bullet) but real content in later blocks would look blank and get silently auto-resolved on a disk overwrite, discarding the local edit with no dialog and no way to undo. Added PendingConflict.pageExistedLocally, computed from whether any block on the page has non-blank content, and switched the auto-resolve check to use that instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Adversarial review caught a real gap in the first version: the auto-resolve check used Pushed a fix (5b5db7b): added |
Android Load BenchmarkInstrumented benchmark on an API 30 x86_64 emulator — 500-page synthetic graph. Comparing Graph Load
Interactive Write Latency (during Phase 3)
SAF I/O Overhead (ContentProvider vs direct File read)Measures Binder IPC cost added by ContentResolver per readFile() call.
|
Summary
checkAndShowPendingConflictonly auto-resolved whenpreviousContent == diskContent(the write-loopback case). It missed the case wherepreviousContentis blank because the page never existed locally before the change (e.g. a host-directory import of a brand-new page) — there's no local edit to protect, so the conflict dialog shouldn't appear.previousContent.isBlank().Reported by the user: pages like a newly-created "SPIFFE" page were surfacing "Compare versions" dialogs showing "(no local edit to compare)".
Test plan
checkAndShowPendingConflict_autoResolves_When_PageNeverExistedLocallyBeforeTheChangetoDiskConflictResolutionTest./gradlew :kmp:jvmTest --tests "dev.stapler.stelekit.ui.DiskConflictResolutionTest"— 23/23 pass, 0 failures