Repository navigation
feat: human-readable refusal when the DB is newer than the binary (#113) - #131
Merged
Merged
Conversation
An old binary against a newer user_version failed with a raw
STORAGE_FAILURE ("failed to open or migrate SQLite storage"). Now the
refusal names both versions and the escape hatch: "the project database
uses schema version N, but this synloq supports up to M. Upgrade synloq
(npm i -g synloq@latest or npx synloq@latest); downgrading requires
exporting your data first — migrations are forward-only (README)".
Regression test: doctored user_version = CURRENT+1 → both versions and
the upgrade path in the message; existing unknown-version refusals
updated to the new wording.
OBenner
commented
Nov 17, 2026
OBenner
left a comment
Owner
Author
There was a problem hiding this comment.
Code review (dev → #113): APPROVE (COMMENT-формой, как ранее — вердикт положительный, к финалу CTO).
Проверено по диффу (f5e0134):
- Разделение веток корректно: newer-than-binary → explicit SynloqError STORAGE_FAILURE с обеими версиями + escape hatch (upgrade path + forward-only дисклеймер со ссылкой на README); undefined/negative → opaque refuse. Старый catch не оборачивает SynloqError — текст доезжает до CLI.
- Согласованность с #118: ветка от ecbd8fa включает мерженный #118 (read-only upgrade-check); полный verify зелёный на этой базе — значит детекция «newer» в doctor --upgrade-check и новый отказ openDatabase сосуществуют (probe ловит STORAGE_FAILURE и маппит в state, либо читает user_version до gate — в любом случае поведение покрыто тестами #118, и они зелёные).
- Тесты: doctored user_version=CURRENT+1 → обе версии + путь в сообщении; обновлённый существующий тест (999/readOnly×2) переведён под новую форму; dedicated-тест пинит и npm-путь, и forward-only формулировку.
- Ограничение в PR честное: doctor versions.schema читает read-only напрямую (намеренно), команды экспорта вне скоупа.
Трек dev2 (#92/#110/#111/#113 → PR #128–#131) закрыт целиком: четыре PR, по отдельным веткам, полный verify на каждом, конфликтов по файлам нет. Качественная работа. Готово к финалу CTO.
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.
Проблема (issue #113)
Старый бинарь против более новой
user_versionпадал с сырымSTORAGE_FAILURE(«failed to open or migrate SQLite storage») — непонятно ни что случилось, ни что делать.Решение
openDatabaseтеперь бросает человекочитаемый отказ приuser_version > CURRENT_SCHEMA_VERSION:Обе версии названы, путь спасения дан, поведение остаётся fail-closed (старый бинарь не угадывает схему). Ошибка проходит catch как SynloqError без обёртки — текст доезжает до CLI как есть.
Тесты
user_version = CURRENT+1→ STORAGE_FAILURE с обеими версиями, upgrade-путём и «forward-only».Полный
pnpm verifyзелёный: 117 файлов / 1027 тестов.Ограничения
versions.schema, [P1] Version telemetry in doctor/status output (reproducible external bug reports) #115) — read-only probe открывает БД напрямую, поэтому диагностика работает и на «слишком новой» БД; это намеренно оставлено: doctor должен уметь смотреть на БД, которую бинарь писать отказывается.Closes #113.