Repository navigation
fix: session restore, explorer links, ESLint, and real-backend e2e (#9, #10, #11, #12) - #192
Conversation
Malware scan: passed, with notes for the reviewerNothing malicious was detected in
|
|
@Deemexlyon This PR now has merge conflicts with git fetch upstream # upstream = https://github.com/DocForum/docforum-web.git
git rebase upstream/main
# resolve the conflicts, re-run the tests, then:
git push --force-with-leaseThe usual culprits are shared files like Automated message. It won't repeat unless the PR conflicts again after your next push. |
ee12829 to
3dcb584
Compare
|
@Deemexlyon Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
3dcb584 to
dab5b8e
Compare
|
@Deemexlyon This PR now has merge conflicts with git fetch upstream # upstream = https://github.com/DocForum/docforum-web.git
git rebase upstream/main
# resolve the conflicts, re-run the tests, then:
git push --force-with-leaseThe usual culprits are shared files like Automated message. It won't repeat unless the PR conflicts again after your next push. |
|
@Deemexlyon This PR now has merge conflicts with git fetch upstream # upstream = https://github.com/DocForum/docforum-web.git
git rebase upstream/main
# resolve the conflicts, re-run the tests, then:
git push --force-with-leaseThe usual culprits are shared docs like Automated message. It won't repeat unless the PR conflicts again after your next push. |
|
@Deemexlyon CI is failing on this branch against the latest E2E smoke (real docforum-core), Frontend (typecheck + lint + test + build)
This PR also conflicts with |
The last `main` → `fix/w1-gaps-issues-9-12` merge resolved conflicts by taking `main`'s whole `package.json` and `src/store/auth-store.ts`, so `npm run lint` and `@eslint/js` were gone and 25 typecheck errors appeared where `session.ts`, `api-client.ts` and `RequireAuth` still expected CSRF/boot-refresh state. Merge both sides again so idle-timeout sign-out (DocForum#82) and reload re-auth (DocForum#9) both work, and clear the CSRF cookie on a timeout sign-out. Also regenerate the lockfile (24 missing transitive packages made `npm ci` refuse to install), fix the four real lint errors the newly-runnable config surfaced, and freeze the browser clock in the visual suite — mock fixtures use absolute dates, so the patient hub's "Invite expired" card flipped every snapshot once Tyke's invite passed. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
@Deemexlyon This PR now has merge conflicts with git fetch upstream # upstream = https://github.com/DocForum/docforum-web.git
git rebase upstream/main
# resolve the conflicts, re-run the tests, then:
git push --force-with-leaseThe usual culprits are shared docs like Automated message. It won't repeat unless the PR conflicts again after your next push. |
|
@Deemexlyon All three jobs fail at Note that this push also dropped the |
🔎 Preview build (downloadable artifact)Download the preview artifact · build log
|
|
@Deemexlyon (and thanks @Kaybee973 for the lockfile fix) Every check is green now, but this PR can't merge: it renames the CI job to Please keep the job's |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
What this PR does
Closes the four open issues in one pass. PRD §4 flows touched: sign-in / session lifecycle (auth guard used by every role dashboard) and the admin payments console (escrow verification, §7 fulfilment payout trail).
#9 — Restore the session on reload
src/services/session.tskicks offPOST /auth/refreshon boot without blocking first render;main.tsxfires it once (skipped when a mock/preview session already exists).RequireAuthwaits in aRestoring your session…state (withuseSlowRequestHint) instead of redirecting a signed-in user to/login.api-client.tsretries an authenticated request once after a401. Concurrent 401s share a single in-flight refresh (refreshSession) because core rotates the cookie on every refresh. A failed refresh (401/403) clears the session; a network failure is treated as transient.docforum-core's Phase 8 CSRF work now requiresX-CSRF-Tokenon/auth/refreshand/auth/logout. The issue text said “cookie-only, no body”, but the live contract needs the header. The per-sessioncsrfTokenis now the only value that survives reload, in a first-partydocforum_csrfcookie (src/services/csrf-storage.ts) — not localStorage/sessionStorage, and never the access/refresh token. Rationale is documented inARCHITECTURE_ESSENTIALS.md“CSRF token storage”.RequireAuthrestoring state, one-refresh-for-concurrent-401s, no refresh recursion, and retry clearing the session.#10 — Explorer links
PaymentIntentPanellinksstellarTxHash→ transaction page andsorobanContractId→ contract page viasrc/features/payments/explorer.ts.rel="noopener noreferrer"; null hash/contract renders no link.VITE_STELLAR_EXPLORER_BASE_URL, documented in.env.example) so mainnet is a config change.#11 — ESLint in CI
eslint.config.js) withtypescript-eslint,eslint-plugin-react-hooks,eslint-plugin-react-refresh,npm run lint, and a lint step in the frontend CI job.anyis allowed only in test files, plus one commented escape hatch in the MSW helper whereHttpResponse<unknown>breaks the handlers' generic constraint.tsc; the TypeScript 6 API is installed under thetypescriptalias for typescript-eslint (its peer range excludes 7), as Microsoft's TS 7 side-by-side guidance recommends.@typescript/nativeprovides the TS 7tsc..npmrcdocuments the peer-range workaround.@sentry/reactdependency —main.tsxalready imported it, sonpm run typecheckwas failing onmainbefore this PR.#12 — E2E smoke test against real
docforum-coree2e/), one journey: sign up → protected page → reload stays signed in → log out → reload stays logged out → log back in.createApp, no payments startup probes) against a throwaway Postgres, plus Vite. No MSW / no network mocks.postgres:16service, pinned core SHA inE2E_CORE_REF, Playwright browser install, and migration step.e2e/README.md.Verification
npm run typecheck✅npm run lint✅ (0 errors; 13 pre-existing warnings)npm test✅ 605/605npm run build,npm run check:dist,npm run check:stellar-boundary✅npm run test:e2e✅ locally against a realdocforum-corecheckout atc65217bc+ throwaway Postgres (signup → reload → logout → reload → login).SameSite=Lax; production isSameSite=None; Secure). The e2e job exercises the real contract and the production cookie path is unchanged from the previously verified connection.Docs
ARCHITECTURE_ESSENTIALS.md: W1 gap removed; CSRF-token storage and session-restore design documented.ROADMAP.md: W1 items [Phase W1] Restore session on reload via POST /auth/refresh #9/Add ESLint and run it in CI #11/End-to-end smoke test against a real docforum-core backend #12 and W5 Link transaction hashes and escrows to the Stellar testnet explorer #10 marked done, top status updated, changelog entry.README.md/e2e/README.md: lint + e2e commands and back-end setup.Closes #9
Closes #10
Closes #11
Closes #12