oscar-web/MILESTONES.md
2026-12-03 15:36:08 -05:00

96 lines
4.4 KiB
Markdown

# Milestones
## 2026-12-03 - Pre-cleanup stable baseline
**Commit:** `cd5beee` ("Block local/private login hosts; clarify bot-check limits")
**Branch:** `main`
**Purpose:** Known-good working version before production cleanup/refactor. If cleanup breaks behavior, return to this commit.
### What works (verified in this cycle)
- Login with screen name/password + math bot check + configurable server host/Web API port/TOC port.
- Local/private/reserved host targets blocked on login (`isDisallowedHost` in `src/routes/auth.js`).
- Web API + TOC login/session wiring; TOC used for IM/chat/invites on 0.25.0.
- 1:1 IM send/receive, chat join/send/receive, chat invite accept/ignore.
- SSE event stream with replay buffer, 3 SSE connections/IP limit.
- SQLite-backed express-session store, corrupt DB rotation/recovery, session cleanup.
- Tab close: PM tabs close locally; chat tabs best-effort leave then close.
- ICQ webui presence overlay: ICQ/all-digit UINs logged into webui show online in webui buddy lists (synthetic SSE presence), without patching oscar-server.
- Buddy list status dots (online/offline), presence updates.
- CSP/Helmet basics, input normalization/length limits, login/API rate limits.
### Quick checks performed before milestone
- `node --check` on touched JS files during recent changes.
- Playwright smoke tests for login/presence flows (steve/8520258 temp accounts).
- Manual curl checks for challenge/login validation and local-host blocking.
### Planned cleanup (do not break behavior)
- Remove unused/redundant code, imports, dead paths, and stale artifacts.
- Simplify where safe; keep behavior identical.
- Keep production hardening intact (sessions, validation, rate limits, host blocking, SSE limits).
- Run syntax/smoke checks after each cleanup step; commit incrementally.
### Rollback
```bash
git checkout main
git reset --hard cd5beee
# or create a branch from it:
git branch pre-cleanup-cd5beee cd5beee
```
## 2026-12-03 - Post-cleanup, pre-refactor baseline
**Commit:** `09e507d` ("Cleanup: remove unused redactParams helper")
**Branch:** `main`
**Purpose:** Stable checkpoint after safe cleanup and before any refactors. Return here if refactors cause regressions.
### State at this checkpoint
- Includes pre-cleanup baseline behavior (`cd5beee`) plus safe cleanup commits.
- Removed unused/dead code: `DEV_ID()`/`bool()` in `src/config.js`, unused `setTyping`/`setChatTyping`/`listPublicRooms`/`redactParams` in `src/oscar.js`, unused `src/features/broadcasts.js`.
- `src/server.js` cleanup: removed unused imports; shutdown now stops TOC sessions and passes `webapiBase` to `endSession`.
- Smoke verified after cleanup: `node --check` on src/public JS, `/api/health`, `/api/challenge`, Playwright login (`steve/please`).
### Refactor candidates (not started)
- Low risk: `oscar.js` base-option helper; shared ICQ/normalization helpers; validation consolidation; dead `loadFeatures()`/stale TODO cleanup.
- Medium risk: split `src/routes/auth.js` login flow; modularize `public/app.js`; dedupe frontend buddy/name helpers; standardize route errors.
- Higher risk/defer: `src/toc.js` protocol refactor, poller/event-shape redesign, CSS restructure without visual tests.
### Rollback
```bash
git checkout main
git reset --hard 09e507d
# or create a branch from it:
git branch post-cleanup-09e507d 09e507d
```
## 2026-12-03 - Post-refactor baseline
**Commit:** `2ba9870` ("Docs: add durable code comments for OSCAR/TOC architecture and gotchas")
**Branch:** `main`
**Purpose:** Stable checkpoint after low/medium refactors and documentation pass, before further production-hardening changes. Return here if later hardening causes regressions.
### State at this checkpoint
- Low/medium refactors complete: `oscar.js` baseOpt helper, shared screenname utils, dead `loadFeatures` removal, host-check extraction, auth login flow split, small frontend buddy helper dedupe, dead frontend style-toggle cleanup.
- Stale M0 TODO code comments removed; durable architecture/protocol/gotcha comments added.
- Verified: `node --check` on src/public JS, `/api/health`, Playwright login smoke (`steve/please`).
### Planned next
- Graceful shutdown polish (close HTTP server, stop sweep timer, close SQLite DB cleanly).
- Process error handlers (`unhandledRejection`, `uncaughtException`) with clear logging/careful exit.
### Rollback
```bash
git checkout main
git reset --hard 2ba9870
# or create a branch from it:
git branch post-refactor-2ba9870 2ba9870
```