Data layer: Backend behind the seam

オープン
#601 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
28/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
csharp, typescript
領域
backend, database

調査の方向性

Start with #584's C# repository and the existing seam, then read the suite's undo group and EditHistory for how undo and redo are currently exercised. The proposal leaves key design questions open, including Discard behavior and milestone scope. Done means a session runs on the C# repository behind a flag with undo and redo, while today's storage remains the default.

索引モデルが issue の本文から書いたものです。

説明

This is an evolving post-Phase-5 proposal, not final decisions.

WebView sees: Nothing. Releasable because: the C# repository runs only behind a flag; today's storage stays the default.

Proposed direction

The CRDT store would keep no drafts: every edit persists. Save would go away. Undo and redo would use the CRDT's own history. Discard would stay in some form, with bookkeeping outside the CRDT if needed.

Scope

Plug #584's C# repository in behind the seam. Whether this is Phase 7 of the Host-owned data layer milestone or opens the next milestone is open (below).

The C# repository passes the suite's required group (#597) with none of these settled. They matter once a session runs on it.

⚠️ Field-level changes (#642) and the revert built on them (#627) are the C# design worth settling early. Undo, redo, and Discard all build on them.

Piece What it takes Where it stands Side
Field-level changes (#642) Send creates, field patches, and deletes instead of whole-record puts Every apply replaces whole records today, so the later commit wins every field, a teammate's included C# and TS
Undo and redo through the CRDT's history (#627) Undo writes a new commit that sets back only the fields the edit changed, undeletes what it deleted, and brings back the links that went with it (#641). Undo can't reach past an incoming commit that touched its records Harmony can't remove a commit, so a revert follows the same last-writer-wins rules as any edit. Open: whether undo overwrites a teammate's later change to the same field. FW Lite has no undo over Harmony to reuse C# for the undelete; TS for EditHistory and the suite
Deletes that cascade (#641) Have apply reply with what changed, cascades included #628 refuses local edits that would cascade. #597's project delete and synced commits still cascade with nothing reported C# and TS
Session open and discards without exportAll (#588) Read the scope record and a query instead of the whole draft Matters once the backend is in C#, where the whole draft would cross PAPI. #597's readAll command is that read, for the conformance suite TS
Record timestamps (#630) Keep what a put carries, as DraftRepository does; stamp the commit time, as #584 does; or both, with creates keeping their timestamps and field changes (#642) getting the commit time Undo would no longer need a put's timestamps; imports, and Save As if it survives, still rely on them. The suite's required group leaves timestamps out of its comparisons, and a DraftRepository test pins today's behavior Either: a small C# change, or TS changes to what relies on it
Scope record (boundaries, languages) (#629) Map it onto #597's InterlinearProject entity, or stay in today's storage #597's entity carries the name, description, target project, analysis languages (added and removed by name), and one segmentation delta with no split by book. CSharpRepository still refuses a change set carrying the scope record TS for the mapping; C# if the entity's shape changes

Also needed before a session runs on it:

  • #618: settle which source ids can name a database file.
  • #521: re-anchor tie-breaks stop depending on the order lookups return links in.

Done when:

  • A session runs on the C# repository behind a flag, undo and redo included, with today's storage still the default.
  • Sync (#256) is either settled, with where shared data lives and how it works with Send/Receive decided, or explicitly deferred: #256 moves off this issue to a later milestone, with a comment here saying so.

Before the C# repository becomes the default

Question Proposal Why it waits
Discard Revert this client's commits since a point, newest first, with their commit ids kept in host storage outside the CRDT Needs the revert above, and the Discard point (open questions)
Save, Save As, the unsaved mark Save would go. The unsaved mark could become "commits since the Discard point" Follows from Discard; Save As is open
New Would create the interlinear project at once (#597's createProject), since apply refuses a project its source's database doesn't store and there is no draft to hold work before it exists Follows from dropping drafts
Seam calls for drafts Split AnalysisRepository so replaceAll, exportForCopy, markClean, and the unsaved mark sit apart from the store calls Follows from dropping drafts. CSharpRepository already throws on these

Later

Question Options Why it waits When
Shared data and Send/Receive (#256) Where shared interlinear data lives, and how it works with Send/Receive Its answer shapes how the CRDT store syncs; the investigation waits on Phase 5 (#428) Before sync ships
Re-anchor passes Stored as commits, or derived on read Only matters once two clients sync the same store Before sync ships
Rules that span records (one approved link per word) Resolve on read, as CountApprovals already does with PrefersLink, or at merge Only a merge can break them Before sync ships
Shards for projects Likely never needed Only if drafts go away before the CRDT store replaces them If at all
When data stops being disposable Pick the moment on purpose Once a shared, synced store ships, schema changes need migrations and the change-set shape gets much harder to change Before the first synced store ships

Open questions

  1. Where does Discard rewind to: session open, a marker the user sets, or the last sync? Does its list of commits survive a restart?
  2. Does Save As survive, as copying a project to a new one, or go with Save? A copy would mint new record ids, since #597 refuses a put under an id stored in another project.
    • If Save survives in any form, is there an autosave setting, so work reaches the project without Save (from #119)? If every edit persists, this goes away.
    • Does closing the Interlinear tab or Paratext warn about unsaved changes (from #284)? With no Save, there may be nothing to warn about.
  3. Should this be Phase 7 of the Host-owned data layer milestone, or open the next milestone? Its done-when goes past the current milestone's.
主要言語
TypeScript
スター
2
フォーク
0
平均マージ
1日 1時間
マージ済み PR(30日)
105

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

sillsdev/interlinearizer-extension のほかの issue

sillsdev/interlinearizer-extension の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。