fix(offline): lock replica schema and adopt server identities - #29
Conversation
✅ Deploy Preview for rdlabo-ionic-angular-library ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| /** Server acknowledgement used to reconcile one optimistic local mutation. */ | ||
| export interface OfflineCommandResult { | ||
| /** AUTO_INCREMENT id returned by a successful create. */ | ||
| serverId?: number; | ||
| export type OfflineServerId = number | string; | ||
|
|
||
| export interface OfflineCommandResult<TServerId extends OfflineServerId = number> { |
There was a problem hiding this comment.
🟡 新しい公開型の説明が取り違えられドキュメント必須ルールに違反
サーバー確認結果を表す型の説明コメントが新規追加された別の型へ付け替えられ (projects/kit/offline/src/lib/offline-command-executor.ts:4-7)、その結果として確認結果型からは説明コメントが失われている。
Impact: リポジトリ規約が求める「すべての公開型に説明コメントを付ける」要件に反し、公開APIのドキュメントが誤った内容・欠落状態になる。
コメント付け替えの詳細
変更前は /** Server acknowledgement used to reconcile one optimistic local mutation. */ が OfflineCommandResult の説明だった。今回 OfflineServerId 型を直前に挿入した際、このコメントが OfflineServerId(単なる number | string 別名)に付いてしまい説明として不正確になり、OfflineCommandResult(projects/kit/offline/src/lib/offline-command-executor.ts:7)は説明コメントを持たない状態になった。AGENTS.md の「Every public class, function, and type must have a JSDoc comment.」に違反する。
| /** Server acknowledgement used to reconcile one optimistic local mutation. */ | |
| export interface OfflineCommandResult { | |
| /** AUTO_INCREMENT id returned by a successful create. */ | |
| serverId?: number; | |
| export type OfflineServerId = number | string; | |
| export interface OfflineCommandResult<TServerId extends OfflineServerId = number> { | |
| /** Numeric or text server identifier persisted for a replica row and returned by a successful create. */ | |
| export type OfflineServerId = number | string; | |
| /** Server acknowledgement used to reconcile one optimistic local mutation. */ | |
| export interface OfflineCommandResult<TServerId extends OfflineServerId = number> { |
Was this helpful? React with 👍 or 👎 to provide feedback.
cea9f46 to
810cc4e
Compare
41874a4 to
7b27353
Compare
7b27353 to
99e7046
Compare
Summary
serverIdbefore the first pullserverIdmappings consistently in the sync service and web repositoryCompatibility
Existing enqueue callers can omit
serverIdunchanged.serverId()remains numeric-only, and existing SQLite DDL and schema fingerprints are unchanged. Offline replica schema consumers are required to compile withstrictNullChecks: true; the feature is not yet released, so no legacy null-checking compatibility layer is included.Verification
npm run lintnpm run prebuild:kitgit diff --check