fix(data): never let the compile_options probe block opening an index

Any failure of the informational PRAGMA compile_options probe is logged
and gives an empty list; before, anything but a SqliteException was cached
by the lazy value and rethrown by every later open.

Tests now cover the decode-tier fields end to end: the Library's
preview-only chip and its plural tooltip, server cards and frames carrying
previewOnlyCount and the preview size over the API.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-12 11:17:55 +00:00
1 parent 5599e4de89
commit bbc7f244fa
4 files changed
+100 -21

No files matched your search

@@ -1,9 +1,12 @@
using Titano.App.Infrastructure;
using Titano.App.Library;
using Titano.Core.Localization;
using Titano.Core.Model;
using Titano.Data.Repositories;
using Titano.Data.Sync;
using Titano.Protocol;
using Titano.Testing;
using Titano.Ui.Controls;
namespace Titano.App.Tests.Library;
@@ -70,6 +73,25 @@ public sealed class RemoteCardsTests
Assert.Equal(SyncState.RemoteOnly, card.SyncState);
}
[Test]
public void PreviewOnlyFramesShowAChipWithTheirCount()
{
// A server sequence of CR3s it reads only through their previews (BRIEF §8.2 tier 2).
var link = Link("Aurora");
var dto = new SequenceDto(link.RemoteId, "Aurora", "Aurora", "2026/2026-02-20 Nikon Z 8", "NIKON CORPORATION", "NIKON Z 8", null,
new DateTime(2026, 2, 20, 21, 0, 0), new DateTime(2026, 2, 21, 1, 8, 0), 1_860, 8.0, 50_000_000_000, (int)SequenceStatus.AnalyzedLight, 0, null,
[], 0, null, 1, 1, 0, null, DateTimeOffset.UtcNow, PreviewOnlyCount: 1_860);
var card = RemoteCards.Build([new SyncEntry(null, link, SyncStatus.RemoteOnly)], new Dictionary<Guid, SequenceDto> { [dto.Id] = dto }).Single();
Assert.Equal(1_860, card.PreviewOnlyCount);
Assert.Equal(1_860, RemoteCards.ToSequence(dto).PreviewOnlyCount);
var chip = SequenceItem.BuildStatuses(card, analysing: false).Single(s => s.Kind == StatusKind.PreviewOnly);
Assert.Equal(Formatting.Count(1_860), chip.Text);
Assert.Equal(Loc.Plural("Tooltips.Library.Status.PreviewOnly", 1_860), chip.ToolTip);
Assert.NotEqual(Loc.Plural("Tooltips.Library.Status.PreviewOnly", 1), chip.ToolTip, "plural forms");
Assert.False(SequenceItem.BuildStatuses(card with { PreviewOnlyCount = 0 }, analysing: false).Any(s => s.Kind == StatusKind.PreviewOnly), "no chip without them");
}
[Test]
public void CardsSortAmongThePagesAndFollowTheFilter()
{