feat(db): migrate fetched_at from TEXT ISO-8601 to INTEGER Unix epoch#348
Merged
feat(db): migrate fetched_at from TEXT ISO-8601 to INTEGER Unix epoch#348
Conversation
Adds a "Database Size:" row to the System Info section of the Info dialog, showing the on-disk size of usage.db formatted as B/KB/MB/GB. The value is read at dialog-open time; no privacy masking needed since file size is not sensitive. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Switch provider_history and raw_snapshots fetched_at columns from 19-byte TEXT strings to 4-byte INTEGER epoch seconds, saving ~15 bytes per row. Adds V11 Evolve migration and legacy ConvertTimestampsToEpochIfNeeded path. All SQL comparisons updated; FetchedAt returned via strftime with 'Z' suffix so Dapper maps DateTimeKind.Utc correctly. Compaction tests truncated to hour/day boundaries to avoid flaky bucket-boundary failures. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
497474e to
7bd0160
Compare
Contributor
Build Performance Report⏱️ Build Time: 12 minutes 📊 Comparison with main branch:
✅ Within acceptable range This is an automated performance check |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
provider_history.fetched_atandraw_snapshots.fetched_atfrom 19-byte TEXT (ISO 8601) to 4-byte INTEGER (Unix epoch seconds), saving ~15 bytes per history rowV11__convert_fetched_at_to_epoch.sql) for fresh installs and clean migration pathsConvertTimestampsToEpochIfNeededinDatabaseMigrationServicefor legacy databases that bypassed Evolve — idempotent, checks column type viaPRAGMA table_infobefore migratingstrftime('%s', 'now') - N)FetchedAtreturned asstrftime('%Y-%m-%dT%H:%M:%SZ', ..., 'unixepoch')so Dapper mapsDateTimeKind.Utccorrectly (avoids stale-detection false positives on non-UTC machines)longused forRecentProviderDetailsRowandStampUsageRatesAsynctuples to avoid Dapper positional-record mapping limitationsTest plan
UsageDatabaseDedup,UsageDatabaseCircuitBreaker,UsageDatabaseRead,UsageDatabasePipeline)baseTimeto hour/day boundary to prevent flaky bucket-boundary failuresGetLatestHistoryAsync_RecentRow_IsNotStaleAsyncpasses on non-UTC machines (UTC kind preserved via 'Z' suffix)🤖 Generated with Claude Code