Files
gitmost/apps
claude code agent 227 8f7da77939 fix(git-sync): correct stale S2-gate comment + drop vestigial currentPage narrowing (#119 F1)
The N1-D1 fix added an early `return {}` when `currentPage == null` in
importPageMarkdown. `currentPage` is a const, never reassigned, so from that
guard onward it is provably non-null — which made the cross-space (S2) gate's
comment false ("a not-found page still proceeds as before": a not-found page
now returns early above) and left dead null-handling around it.

- Rewrite the S2-gate comment: the null case is handled by the N1-D1 guard
  above; here currentPage is guaranteed non-null. Confused-deputy / cross-space /
  mirror-deletePage explanation kept intact.
- Drop the dead `currentPage &&` conjunct from the S2 condition (always true).
- Collapse downstream vestigial `currentPage?.` / `currentPage!` / the
  `currentPage ? … : undefined` ternary to plain `currentPage.` — all
  behavior-preserving (currentPage non-null after the guard). The unrelated
  `page ? … : undefined` ternary (fresh findById that can be null) is untouched.

No runtime behavior change. jest gitmost-datasource.service.spec.ts: 34 passed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-03 07:16:49 +03:00
..