Repository navigation
fix(store): migrate workspace archive column before startup validation - #1496
Merged
Merged
Conversation
tallcode
enabled auto-merge (squash)
November 4, 2026 07:03
huichen
added a commit
that referenced
this pull request
Nov 16, 2026
The choice mark reached SCHEMA (and the best-effort ADDED_COLUMNS list) without a contract step, so a database already at version 6 — the released contract, and every desktop written by it — has no such column. Startup reads the header, sees �ersion == APP_DB_SCHEMA_VERSION, runs �alidate_core before any migration can touch the table, and refuses to open: Desktop database is incomplete: required runs.offers_choice is missing. The same shape as #1496 (workspaces.archived_at): ADDED_COLUMNS only runs from �pply_schema, i.e. on a fresh database, never on the current-version path. Adopt the column under contract 7, with the released 6 kept immutable: - uns_offers_choice.sql adds the column; ADDITIVE_COLUMN_STEPS skips the ALTER on a fresh install or a build that wrote the column early, so an existing mark and its row survive either layout. - APP_DB_SCHEMA_VERSION 6 -> 7, so the upgrade is checksummed, transactional and snapshotted before it runs. - Drop the ADDED_COLUMNS entry: the contract step now owns the column. Tests cover both layouts (missing column fails �alidate_core first, an early column is recorded without replaying), the double-open idempotence, and a rollback that retries from its ledger like the other steps. ER.md documents the run field.
huichen
added a commit
that referenced
this pull request
Nov 16, 2026
…bile share cache (#1630) * fix(mobile): reclaim the share export cache instead of refusing Opening or sharing an attachment hands the OS a copy under `futureos-exports`, kept for 24 hours. The cap that guarded that directory only ever counted, never reclaimed: once 100 MB of copies (or 128 of them) accumulated, every later handoff threw `attachment_export_cache_full` and kept throwing until retention expired — a burst of 7 MB podcast wavs was enough to lock sharing for a whole day. Reclaim instead of refusing. Copies older than `EXPORT_PROTECT_MS` go first, because a handoff is a live `content://` grant an app may still be reading; if a burst inside that window leaves no room, a second pass reclaims the oldest anyway. Refusal now survives only for a single file larger than the whole budget, which the transfer layer already rules out, and it deletes nothing on the way out. The refusal code also reached the user verbatim, because the handoff alert appends the failure's own words on Android. Keep that for native failures — they name the URI grant or chooser that refused — but map our own code to `attachment.exportCacheFull` in both locales. * fix(store): migrate runs.offers_choice before startup validation The choice mark reached SCHEMA (and the best-effort ADDED_COLUMNS list) without a contract step, so a database already at version 6 — the released contract, and every desktop written by it — has no such column. Startup reads the header, sees �ersion == APP_DB_SCHEMA_VERSION, runs �alidate_core before any migration can touch the table, and refuses to open: Desktop database is incomplete: required runs.offers_choice is missing. The same shape as #1496 (workspaces.archived_at): ADDED_COLUMNS only runs from �pply_schema, i.e. on a fresh database, never on the current-version path. Adopt the column under contract 7, with the released 6 kept immutable: - uns_offers_choice.sql adds the column; ADDITIVE_COLUMN_STEPS skips the ALTER on a fresh install or a build that wrote the column early, so an existing mark and its row survive either layout. - APP_DB_SCHEMA_VERSION 6 -> 7, so the upgrade is checksummed, transactional and snapshotted before it runs. - Drop the ADDED_COLUMNS entry: the contract step now owns the column. Tests cover both layouts (missing column fails �alidate_core first, an early column is recorded without replaying), the double-open idempotence, and a rollback that retries from its ledger like the other steps. ER.md documents the run field.
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.
Nightly 110 made
workspaces.archived_ata required startup field without advancing the app database contract from version 4. An existing nightly 109 database therefore fails core validation before the desktop event loop starts, which can appear as no response when the Windows executable is double-clicked.Advance the database contract to version 5 and add a transactional, checksummed migration before core validation. Databases without the column gain a nullable archive timestamp; fresh/nightly-110 databases that already contain it retain their existing values. Keep the existing pre-upgrade snapshot mechanism and roll back schema changes together with the migration ledger on failure.
Add regression cases for both released version-4 layouts, repeated initialization, preservation of history/database identity, and rollback/retry after a ledger-write failure. Update the older migration fixture to rewind all later ledger entries.
Validation:
cargo fmt -p future-host -p future-app-settings --checkpassed.cargo clippy -p future-host -p future-app-settings --all-targets --locked --offline -- -D warningspassed (withRUSTC_WRAPPER=to bypass unavailable local sccache).