Skip to content

Fix sync, CI, perf, correctness (I.5) + repo hygiene (I.6) - #12

Draft
PaperPit wants to merge 10 commits into
mainfrom
cursor/fix-multi-device-data-loss-0aab
Draft

Fix sync, CI, perf, correctness (I.5) + repo hygiene (I.6)#12
PaperPit wants to merge 10 commits into
mainfrom
cursor/fix-multi-device-data-loss-0aab

Conversation

@PaperPit

@PaperPit PaperPit commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Problem (audit 2.x–3.x + I.4–I.6)

Sync / tooling / SW precache / frontend perf as before.

I.5 Correctness: inverted rich-editor menu close; flip-card keydown leak; FSRS keys 1–2 only; store: any; irreversible deletes; offline banner cloud-only / no offline listener; stats missing banner.

I.6 Junk/docs: tracked deploy zip (with Supabase URL), design tar, __pycache__, .cursor/settings.json, committed extension/dist/*.js; РАЗРАБОТКА.md stale (no-build claim, missing js/srs.js, wrong test counts).

Fix

  • Sync 2.1–2.6; ESLint/CI/e2e/coverage; SW from dist + cache-first/SWR; folder search/virtual-list; lazy CSS; motion/LRU (I.4)
  • I.5: rich-editor outside-click + sanitized paste + destroy; flip destroy + keys 1–4; AppStore typing; delete undo via toastAction; offline banner for local + offline event; stats banner
  • I.6: untrack junk + extension/dist/; update РАЗРАБОТКА.md / .gitignore / CLAUDE. Side Panel copy left as-is (extension still ships side panel on this branch)

Verify

  • npm test — 377 passed
  • npm run typecheck — clean
  • npm run build:bundle && npm run sw:check / ext:check — OK
Open in Web Open in Cursor 

cursoragent and others added 2 commits July 25, 2026 15:07
Three bugs caused silent overwrite across devices:
1. Queued PATCHes applied without updated_at=lte (last connector won)
2. Background sync pulled before flushing the offline queue
3. Settings blob upsert ignored remote/local stamps

Apply LWW filters on card/folder/box patches, flush then pull on
background sync, and resolve settings by updated_at.

Co-authored-by: PaperPit <PaperPit@users.noreply.github.com>
- PATCH with baseUpdatedAt (eq) and treat 0 rows as conflict → dead letter
- Full/delta pull writes card bodies into IDB mirror (not only SRS meta)
- Review hydrate refetches missing bodies online; shows offline gap toast

Co-authored-by: PaperPit <PaperPit@users.noreply.github.com>
@cursor cursor Bot changed the title Fix multi-device data loss (LWW + flush-before-pull) Fix multi-device sync: LWW OCC, card mirror, hydrate gaps Jul 25, 2026
- Bind offline uploadImage to cardId/side; never push data: URLs to Postgres
- Confirm algo switch and seed target columns from source progress
- Review log: real elapsed_days; mark binary grades synthetic for optimizer/CSV

Co-authored-by: PaperPit <PaperPit@users.noreply.github.com>
@cursor cursor Bot changed the title Fix multi-device sync: LWW OCC, card mirror, hydrate gaps Fix multi-device sync + images, algo switch, FSRS log honesty Jul 25, 2026
- Wire typescript-eslint + prettier into eslint.config.cjs with files/rules
- Use \`eslint js\` / quoted prettier globs (dash has no globstar)
- Align .prettierrc with repo style; clear no-useless-* errors for green lint

Co-authored-by: PaperPit <PaperPit@users.noreply.github.com>
@cursor cursor Bot changed the title Fix multi-device sync + images, algo switch, FSRS log honesty Fix multi-device sync + make ESLint/prettier actually run Jul 25, 2026
cursoragent and others added 2 commits July 25, 2026 15:30
- Delete dead vitest.config.js (keep .ts with happy-dom + alias)
- CI: coverage thresholds, functions:check, ext:check, Playwright smoke
- Deploy waits for successful CI on main (workflow_run), not bare push
- Extract/test API key validators; lint functions; fix e2e home selectors

Co-authored-by: PaperPit <PaperPit@users.noreply.github.com>
Co-authored-by: PaperPit <PaperPit@users.noreply.github.com>
@cursor cursor Bot changed the title Fix multi-device sync + make ESLint/prettier actually run Fix sync bugs + make CI real (e2e, coverage, deploy gate) Jul 25, 2026
Walking gitignored js/*.js let orphan modules into CORE_FILES; a committed
sw.js with a missing path makes cache.addAll fail atomically on clean deploy.

- Shared scripts/lib/sw-precache.mjs: dist walk + TS→JS mapping
- Root sw.js from sources; dist/sw.js from build output (bundle.mjs)
- npm run sw:check + CI step after build:bundle

Co-authored-by: PaperPit <PaperPit@users.noreply.github.com>
@cursor cursor Bot changed the title Fix sync bugs + make CI real (e2e, coverage, deploy gate) Fix sync bugs + make CI real (e2e, coverage, SW precache, deploy gate) Jul 25, 2026
- SW: cache-first hashed chunks, SWR for shell; exclude screen/motion
  entries and non-RU font subsets from precache; modulepreload in bundle
- Folder: debounce search + precomputed index; measure virtual row height;
  delete without full route(); cache listOffset
- Global error/rejection toasts; grading catch; activity idbSave resolves
- Lazy screen CSS via ensureCss; dynamic motion import + stagger cap;
  flip-card batch measure; card-img-slot; folderCache LRU (max 5)

Co-authored-by: PaperPit <PaperPit@users.noreply.github.com>
@cursor cursor Bot changed the title Fix sync bugs + make CI real (e2e, coverage, SW precache, deploy gate) Fix sync bugs + CI + frontend perf (SW, search, lazy CSS) Jul 25, 2026
cursoragent and others added 2 commits July 25, 2026 15:52
- rich-editor: outside-click closes highlight menu; paste sanitized; destroy on modal close
- flip-card: destroy keydown; FSRS keys 1–4; session passes destroy
- store typed as LocalStore|CloudStore (drop any); AnswerSoundSettings; algo typo leitner
- delete card/folder: toastAction undo restore; offline banner for local + offline event
- stats: offlineBanner; untrack zip/tar/pycache/.cursor/settings + extension/dist JS
- РАЗРАБОТКА.md aligned with tsc / test counts / layout

Co-authored-by: PaperPit <PaperPit@users.noreply.github.com>
Co-authored-by: PaperPit <PaperPit@users.noreply.github.com>
@cursor cursor Bot changed the title Fix sync bugs + CI + frontend perf (SW, search, lazy CSS) Fix sync, CI, perf, correctness (I.5) + repo hygiene (I.6) Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants