You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: new-deepnotes/PLAN_PROGRESS.md
+22-6Lines changed: 22 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
Living checklist for the greenfield work described in [docs/RESTART_PLAN.md](../docs/RESTART_PLAN.md). Update this file when phases advance or decisions change.
4
4
5
-
**Last reviewed:** 2026-04-26
5
+
**Last reviewed:** 2026-04-27
6
6
7
7
---
8
8
@@ -13,7 +13,7 @@ Living checklist for the greenfield work described in [docs/RESTART_PLAN.md](../
-[x]**Worker smoke:**`503` when env/DB not configured for `/api/users/me/email-change` (+ confirm), alongside other session routes.
41
-
-[x]**DB integration:**`email-change.integration.test.ts` — `performUserRegister` → `performUserEmailChangeRequest` → `performUserEmailChangeConfirm` on a **clone** of migrated Postgres (template `dn_test_tpl_session_email`, distinct from `@deepnotes/db`’s `dn_test_tpl_deepnotes` for parallel Turbo); asserts decrypted email, `email_hash`, cleared pending fields; wrong-password request → **400**. Skips when `DATABASE_URL` / admin URL unavailable (`describe.skipIf`).
41
+
-[x]**DB integration (template Postgres):**`account-flows.integration.test.ts` (renamed from `email-change.integration.test.ts`). See [Phase 3 test coverage (detail)](#phase-3-test-coverage-detail) for the per-case list.
42
+
43
+
### Phase 3 test coverage (detail)
44
+
45
+
Integration tests use `describe.skipIf` when `DATABASE_URL` (and admin URL for `CREATE DATABASE`) are unset; they clone template `dn_test_tpl_session_email` (isolated from `@deepnotes/db`’s `dn_test_tpl_deepnotes` so **Turbo** can run both packages in parallel).
46
+
47
+
| Test case | Exercises | Assertions |
48
+
|-----------|-----------|------------|
49
+
| Register → email-change request → confirm |`performUserRegister`, `performUserEmailChange*`, `signAccessToken`| New email in `decryptUserEmail` + `email_hash` match; `encrypted_new_email` / `email_verification_code` cleared; clear-session cookie lines on confirm. |
50
+
| Email change request, wrong password |`performUserEmailChangeRequest`|**400**`BAD_REQUEST` when `oldLoginHash` does not match. |
| Password change, happy path |`performUserPasswordChange`| After change: PHC decrypts to a hash matching **new** password; private + symmetric keyrings **unwrap** with the same `derivePasswordValues` key as login (salt from stored PHC), round-trip to the new keyring bytes passed in. |
53
+
| Password change invalidates sessions |`performUserPasswordChange` + explicit `devices` / `sessions` insert |`sessions.invalidated === true` for the user. |
54
+
| Password change, wrong old password |`performUserPasswordChange`|**400**`BAD_REQUEST`. |
55
+
56
+
**Not yet in integration:**`performSessionLogin` + refresh (cookie/session rows), Redis failed-login with real `ioredis`/Upstash, demo account **403** on password change (covered in unit path via `performUserPasswordChange` branches if added later).
42
57
43
58
### Sessions + account (current)
44
59
@@ -116,7 +131,7 @@ Cross-cutting work so the new SPA does not repeat **legacy `apps/client`** patte
116
131
| Package / app | Role | What runs today | Gaps (highest value next) |
|**`@deepnotes/api`**| Zod + OpenAPI |`openapi.test.ts` (health + route registry); **`schemas/users.test.ts`** (email/password change bodies, 6-digit code) | Schemas for sessions + remaining routes; optional **snapshot** of OpenAPI fragment for drift |
121
136
|**`@deepnotes/api-worker`**| Hono on Worker |`index.test.ts`: health, OpenAPI JSON, **503** when secrets/DB not bound (incl. email-change paths) |**200-path tests** with test `SessionEnv` + Hyperdrive stub + template DB (heavier CI job) |
122
137
|**`@deepnotes/web`**| SPA |`app.test.ts` (mount `App.vue`) | Auth UI + API client as in §5.8 |
@@ -139,8 +154,8 @@ Cross-cutting work so the new SPA does not repeat **legacy `apps/client`** patte
139
154
-[ ] Drizzle migrations from empty DB documented for production upgrades.
140
155
-[ ] Cold API dev start under **2 s** (no `inspect-brk` by default) — validate on a typical laptop.
141
156
-[ ] Collab + realtime: at least one integration test each (Redis + deps).
0 commit comments