A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!
TypeScript agent-skillsaidsh-pluginhacktoberfestjavascriptmcp-serverreactresume-builderself-hostedtypescript
fix: preserve imported and first-submission review history
Amruth Pillai6551c3af2e71
diff --git a/apps/mobile/scripts/application-review.test.mjs b/apps/mobile/scripts/application-review.test.mjsindex 28753e691..85913e90f 100644--- a/apps/mobile/scripts/application-review.test.mjs+++ b/apps/mobile/scripts/application-review.test.mjs@@ -178,7 +178,7 @@ test("native first-submission review stays read-only and legacy/version history}});-test("native Apply reacts to unsaved typing and copies the current draft before autosave returns", async () => {+test("native Apply copies unsaved drafts and opens first-submission or legacy recorded answers", async () => {const rootRequire = createRequire(root + "/package.json");const React = rootRequire("react");const { act } = React;@@ -197,6 +197,7 @@ test("native Apply reacts to unsaved typing and copies the current draft before);const values = new Map();let copied;+ let savedItems = [];const data = { ...empty, answers: [{ id: "first", question: "Why?", answer: "", factIds: [] }] };const { Apply, saves } = load(data, {react: React,@@ -225,7 +226,7 @@ test("native Apply reacts to unsaved typing and copies the current draft before},useAutosave: (value, _saved, save) => ({ flush: () => save(value) }),latest: () => undefined,- useSavedItems: () => ({ data: [] }),+ useSavedItems: () => ({ data: savedItems }),useFacts: () => ({ data: [] }),useGenerate: () => ({}),},@@ -240,6 +241,7 @@ test("native Apply reacts to unsaved typing and copies the current draft beforeuseWorking: (_pending, _steps, fallback) => fallback,workingSteps: () => [],},+ "@/features/application-detail/sections": { WhatYouSent: () => null },"../preparation": { Preparation: () => null },"../answer-library": { AnswerLibrary: () => null },"@/features/ai/providers": { useHasAIProvider: () => ({}) },@@ -282,6 +284,35 @@ test("native Apply reacts to unsaved typing and copies the current draft beforeawait act(async () => values.get("Why?")(" "));assert.equal(find("Copy answers"), undefined);assert.equal(find("Download"), undefined);+ const first = { id: "first-version", submission: true, data: { kind: "answers", answers: [] } };+ const later = { ...first, id: "later-version" };+ savedItems = [later, first];+ for (const kind of ["first receipt", "legacy"]) {+ data.submissionReview =+ kind === "legacy"+ ? null+ : {+ at: "2026-11-03T10:00:00Z",+ checklist: [],+ documents: false,+ answers: true,+ answerVersionId: first.id,+ };+ let destination;+ await act(async () =>+ owner.render(+ React.createElement(Apply, {+ key: kind,+ application: { ...application, status: "applied" },+ go: (...args) => {+ destination = args;+ },+ }),+ ),+ );+ await act(async () => find("View recorded answers").click());+ assert.deepEqual(destination, ["apply", { version: kind === "legacy" ? later.id : first.id }]);+ }} finally {await act(async () => owner.unmount());window.happyDOM.abort();diff --git a/apps/mobile/src/features/workspace/tabs/apply.tsx b/apps/mobile/src/features/workspace/tabs/apply.tsxindex b938d6891..e520657b6 100644--- a/apps/mobile/src/features/workspace/tabs/apply.tsx+++ b/apps/mobile/src/features/workspace/tabs/apply.tsx@@ -63,6 +63,8 @@ function Apply({ application, version, go }: WorkspaceTabProps) {const facts = useFacts(application.id);const readOnlyVersion = version?.data.kind === "answers" ? version.data : undefined;const recorded = saved.data?.find((item) => item.submission && item.data.kind === "answers");+ const reviewed =+ saved.data?.find((item) => item.id === workspace.data?.submissionReview?.answerVersionId) ?? recorded;const candidate = recorded ?? (!hasApplicationSubmission(application) ? latest(saved.data, "answers") : undefined);const sentItem = candidate?.data.kind === "answers" ? { ...candidate, data: candidate.data } : undefined;// Removed questions wait out their Undo here; the workspace drops them when the toast closes.@@ -183,13 +185,13 @@ function Apply({ application, version, go }: WorkspaceTabProps) {<Text variant="heading" accessibilityRole="header" style={{ flex: 1 }}>{t`Form answers`}</Text><Button variant="link" label={t`Edit profile`} onPress={() => router.push(routes.settings("profile"))} />{!version && submitted ? (- recorded ? (+ reviewed ? (<Buttonvariant="link"size="sm"icon="clock-counter-clockwise"label={t`View recorded answers`}- onPress={() => go("apply", { version: recorded.id })}+ onPress={() => go("apply", { version: reviewed.id })}/>) : (<Text variant="callout" color="ink3">{t`No recorded answers are available.`}</Text>diff --git a/apps/web/src/features/career/workspace/apply.tsx b/apps/web/src/features/career/workspace/apply.tsxindex 8b41a3fe3..f4c93f9f2 100644--- a/apps/web/src/features/career/workspace/apply.tsx+++ b/apps/web/src/features/career/workspace/apply.tsx@@ -75,6 +75,8 @@ export function ApplyTab({ application, version, go }: WorkspaceTabProps) {const { data: facts } = useQuery(orpc.career.facts.queryOptions({ input: { applicationId: application.id } }));const readOnlyVersion = version?.data.kind === "answers" ? version.data : undefined;const recorded = saved.data?.find((item) => item.submission && item.data.kind === "answers");+ const reviewed =+ saved.data?.find((item) => item.id === workspace.data?.submissionReview?.answerVersionId) ?? recorded;const candidate = recorded ?? (!hasApplicationSubmission(application) ? latest(saved.data, "answers") : undefined);const sentItem = candidate?.data.kind === "answers" ? { ...candidate, data: candidate.data } : undefined;// Removed questions wait out their Undo here; the workspace drops them when the toast closes.@@ -211,12 +213,12 @@ export function ApplyTab({ application, version, go }: WorkspaceTabProps) {</Link>{!version &&hasApplicationSubmission(application) &&- (recorded ? (+ (reviewed ? (<Buttonsize="sm"variant="ghost"className="-me-2.5"- onClick={() => go("apply", { version: recorded.id })}+ onClick={() => go("apply", { version: reviewed.id })}><Icon name="clock-counter-clockwise" size={16} /><Trans>View recorded answers</Trans>diff --git a/apps/web/src/features/career/workspace/workspace.test.tsx b/apps/web/src/features/career/workspace/workspace.test.tsxindex a8308db30..db533193d 100644--- a/apps/web/src/features/career/workspace/workspace.test.tsx+++ b/apps/web/src/features/career/workspace/workspace.test.tsx@@ -41,7 +41,7 @@ vi.mock("@/libs/orpc/client", () => {});return {orpc: {- documents: { list: endpoint("documents") },+ documents: { list: endpoint("documents"), linkApplication: endpoint("linkApplication") },applications: {getById: endpoint("application"),listSummary: endpoint("applications"),@@ -759,3 +759,27 @@ it("offers answer actions immediately for an unsaved draft and hides them when cexpect(screen.queryByRole("button", { name: "Copy answers" })).toBeNull();expect(screen.queryByRole("button", { name: "Download" })).toBeNull();});++it.each(["first receipt", "legacy"] as const)("opens the correct recorded answers for %s", async (kind) => {+ const first = {+ ...item("first", { kind: "answers", answers: [{ question: "Why?", answer: "First submission" }] }),+ submission: true,+ };+ const later = {+ ...item("later", { kind: "answers", answers: [{ question: "Why?", answer: "Later submission" }] }),+ submission: true,+ };+ api.data.savedItems = [later, first];+ api.data.workspace = {+ ...EMPTY_WORKSPACE,+ answers: [{ id: "draft", question: "Why?", answer: "Current draft", factIds: [] }],+ submissionReview:+ kind === "legacy"+ ? null+ : { at: "2026-11-03T10:00:00Z", checklist: [1], documents: false, answers: true, answerVersionId: first.id },+ };+ const go = vi.fn();+ mount(<ApplyTab {...props} application={{ ...application, status: "applied" }} go={go} />);+ fireEvent.click(await screen.findByRole("button", { name: "View recorded answers" }));+ expect(go).toHaveBeenCalledWith("apply", { version: kind === "legacy" ? later.id : first.id });+});diff --git a/docs/guides/career-workspace-reference.mdx b/docs/guides/career-workspace-reference.mdxindex 1ff112a37..4e64696c9 100644--- a/docs/guides/career-workspace-reference.mdx+++ b/docs/guides/career-workspace-reference.mdx@@ -43,7 +43,7 @@ In **Applications**, **Needs you** narrows List, Board, Calendar and Insights to| **Messages** | **Add offer**, **Read it for me** | Employer message, suggested reply and reviewable application changes. || **Library** | **Open in…** | Earlier generated material and saved offer or answer versions. |-Saved jobs open on **Apply**, where the preparation card names the current step as its heading with that step's action, and shows the **Posting**, **Resume** and **Cover letter** rows with **Edit** and an options menu (download PDF, copy, write a letter, clear). The step follows missing posting text, documents, answers and your manual review checks. AI is optional. Submitted jobs show **What you sent** with per-document draft options and **View recorded answers**; **Review checks** shows relevant manual checks as a read-only first-submission record, without an unfinished count. Missing historical review is labelled explicitly; empty answer copy/download actions are hidden. The other initial tabs follow the application's stage and interview timing. Select any tab to work elsewhere. The context column shows the next step, people, documents and notes for the job.+Saved jobs open on **Apply**, where the preparation card names the current step as its heading with that step's action, and shows the **Posting**, **Resume** and **Cover letter** rows with **Edit** and an options menu (download PDF, copy, write a letter, clear). The step follows missing posting text, documents, answers and your manual review checks. AI is optional. Submitted jobs show **What you sent** with per-document draft options and **View recorded answers**, opening the first submission’s answers when its review record is available (otherwise the latest recorded answers); **Review checks** shows relevant manual checks as a read-only first-submission record, without an unfinished count. Missing historical review is labelled explicitly; empty answer copy/download actions are hidden. The other initial tabs follow the application's stage and interview timing. Select any tab to work elsewhere. The context column shows the next step, people, documents and notes for the job.The native iPhone app opens the relevant tab through a task-named action in application details, such as **Prepare application** or **Draft a follow-up**. Workspace arrows reveal additional tabs when the strip is wider than the screen. Native Knowledge uses inline **Facts**, **Stories** and **Preferences** choices. [Native iPhone controls](/guides/editing-on-mobile#native-android-and-iphone-apps) also explains unsynced recovery and form dismissal.diff --git a/docs/guides/first-career-application.mdx b/docs/guides/first-career-application.mdxindex 85d4d71cd..4a870e814 100644--- a/docs/guides/first-career-application.mdx+++ b/docs/guides/first-career-application.mdx@@ -88,7 +88,7 @@ If you are still practicing this tutorial, leave the application at **Saved**. YAfter you record submission, **Review checks** shows the relevant checks as a read-only record, without an unfinished count. It preserves your ticks at the first recorded submission; submission does not check anything for you. Older submissions without review history say **Historical review checks unavailable.**-Use **View recorded answers** to read the saved submission separately from current drafts. A cover letter and form answers are optional when the employer does not request them. Review checks record your acknowledgement; they do not certify readiness or employer receipt.+Use **View recorded answers** to read the first review-linked submission separately from current drafts. For older history without that link, it opens the latest recorded answers. A cover letter and form answers are optional when the employer does not request them. Review checks record your acknowledgement; they do not certify readiness or employer receipt.## What you now havediff --git a/docs/guides/managing-an-application.mdx b/docs/guides/managing-an-application.mdxindex 46040bd78..f39710d13 100644--- a/docs/guides/managing-an-application.mdx+++ b/docs/guides/managing-an-application.mdx@@ -125,7 +125,7 @@ In the web and native apps, a missing document can also show **Use _document namSent snapshots stay accessible while a linked document is in Trash. In the workspace, **Apply → Mark as applied** records the current written answers, document versions and stage together.-Recording submission here also updates **Apply**: **Review checks** keeps a read-only record of relevant manual checks at the first recorded submission, without an unfinished count or instruction to submit. Later stage, document or draft changes cannot replace it. The saved answers linked to that first submission show the same recorded checks; unrelated saved answer versions do not inherit them. Older submissions without review history say **Historical review checks unavailable.**+Recording submission here also updates **Apply**: **Review checks** keeps a read-only record of relevant manual checks at the first recorded submission, without an unfinished count or instruction to submit. Later stage, document or draft changes cannot replace it. **View recorded answers** opens the answers linked to that first submission when available, with the latest recorded answers as the fallback for older history. Those first-submission answers show the same recorded checks; unrelated saved answer versions do not inherit them. Older and imported submissions without review history say **Historical review checks unavailable.**### Attaching a PDF insteaddiff --git a/packages/api/src/features/applications/service.ts b/packages/api/src/features/applications/service.tsindex 519395516..44816acbb 100644--- a/packages/api/src/features/applications/service.ts+++ b/packages/api/src/features/applications/service.ts@@ -919,7 +919,7 @@ export const applicationService = {}const rows = await tx.insert(schema.application).values(values).returning();for (const row of rows) {- await recordSentResume(row, tx);+ await recordSentResume(row, tx, true);if (row.followUpAt) await syncFollowUp(tx, row);if (row.coverLetterId)await linkLetterToApplication(tx, {diff --git a/packages/api/src/features/career/service.integration.test.ts b/packages/api/src/features/career/service.integration.test.tsindex 1e4da85ba..cda155761 100644--- a/packages/api/src/features/career/service.integration.test.ts+++ b/packages/api/src/features/career/service.integration.test.ts@@ -2038,6 +2038,35 @@ describe.skipIf(!databaseUrl)("career knowledge, context and data lifecycle", ()},);+ it.each(["applied", "interview", "offer"] as const)(+ "keeps imported %s review history unavailable",+ async (status) => {+ await applications.importMany({+ userId: "alice",+ items: [+ {+ company: "Imported history",+ role: "Engineer",+ status,+ applicationDate: "2020-01-10",+ resumeId: "shared-resume",+ },+ ],+ });+ const [row] = await getDb()+ .select()+ .from(tables.application)+ .where(eq(tables.application.company, "Imported history"));+ if (!row) throw new Error("Missing imported application.");+ expect(row.sentResumeVersionId).toEqual(expect.any(String));+ expect(row.submittedAt).toBeInstanceOf(Date);+ expect((await service.workspace("alice", row.id)).submissionReview).toBeNull();+ await applications.update({ userId: "alice", id: row.id, status: "saved" });+ await service.submitApplication("alice", row.id, [], []);+ expect((await service.workspace("alice", row.id)).submissionReview).toBeNull();+ },+ );+it("does not invent legacy review history or accept a client replacement", async () => {expect((await service.workspace("alice", "alice-app")).submissionReview).toBeNull();await expect(diff --git a/tests/e2e/specs/application-submission.spec.ts b/tests/e2e/specs/application-submission.spec.tsindex ec74eac5b..d427526e7 100644--- a/tests/e2e/specs/application-submission.spec.ts+++ b/tests/e2e/specs/application-submission.spec.ts@@ -155,6 +155,27 @@ for (const entry of ["detail", "workspace", "api"] as const) {}),).toBeOK();expect((await (await page.request.get(workspaceUrl)).json()).submissionReview).toEqual(receipt.submissionReview);+ if (entry === "workspace") {+ await expect(await page.request.put(`/api/openapi/applications/${id}`, { data: { status: "saved" } })).toBeOK();+ const laterAnswers = receipt.answers.map((answer: { answer: string }) => ({+ ...answer,+ answer: "Later submission answer",+ }));+ await expect(+ await page.request.post(`${workspaceUrl}/submit`, {+ data: { answers: laterAnswers, expectedAnswers: receipt.answers },+ }),+ ).toBeOK();+ expect((await (await page.request.get(workspaceUrl)).json()).submissionReview).toEqual(receipt.submissionReview);+ const saved = await page.request.get(`/api/openapi/career/saved?applicationId=${id}&kind=answers`);+ await expect(saved).toBeOK();+ expect((await saved.json())[0].id).not.toBe(receipt.submissionReview.answerVersionId);+ await page.goto(`/dashboard/applications/${id}/apply`);+ await page.getByRole("button", { name: "View recorded answers", exact: true }).click();+ await expect(page).toHaveURL(new RegExp(`version=${receipt.submissionReview.answerVersionId}`));+ await expect(page.locator("#application-readiness")).toContainText("Review checks recorded at first submission.");+ await expect(page.getByText("Later submission answer", { exact: true })).toHaveCount(0);+ }if (entry === "detail")await page.getByRole("heading", { name: "Review checks", exact: true })@@ -245,3 +266,35 @@ test("Apply copies and downloads the first unsaved answer while offline, then hiawait page.context().setOffline(false);}});++test("Imported sent stages keep unknown manual review history after reopening and resubmission", async ({+ authPage: page,+}) => {+ for (const status of ["applied", "interview", "offer"]) {+ const company = `Imported ${status}`;+ await expect(+ await page.request.post("/api/openapi/applications/import", {+ data: { items: [{ company, role: "Historical engineer", status, applicationDate: "2020-01-10" }] },+ }),+ ).toBeOK();+ const listed = await page.request.get("/api/openapi/applications");+ await expect(listed).toBeOK();+ const application = (await listed.json()).find((row: { company: string }) => row.company === company);+ expect(application).toBeDefined();+ const path = `/api/openapi/career/workspace/${application.id}`;+ const verify = async () => {+ const workspace = await page.request.get(path);+ await expect(workspace).toBeOK();+ expect((await workspace.json()).submissionReview).toBeNull();+ await page.goto(`/dashboard/applications/${application.id}/apply`);+ await expect(page.locator("#application-readiness")).toContainText("Historical review checks unavailable.");+ await expect(page.locator("#application-readiness").getByRole("checkbox")).toHaveCount(0);+ };+ await verify();+ await expect(+ await page.request.put(`/api/openapi/applications/${application.id}`, { data: { status: "saved" } }),+ ).toBeOK();+ await expect(await page.request.post(`${path}/submit`, { data: { answers: [], expectedAnswers: [] } })).toBeOK();+ await verify();+ }+});diff --git a/tests/e2e/specs/stage-write-order.spec.ts b/tests/e2e/specs/stage-write-order.spec.tsindex 8f02f8d67..fa1058ae8 100644--- a/tests/e2e/specs/stage-write-order.spec.ts+++ b/tests/e2e/specs/stage-write-order.spec.ts@@ -247,6 +247,9 @@ for (const action of ["reply", "submission"] as const)await api(page, "post", `/career/saved/${reply.id}/apply`, { changes: [0] });await api(page, "put", `/applications/${id}`, { status: "offer" });} else {+ await expect(+ page.locator("#application-readiness").getByRole("button", { name: "Mark as applied", exact: true }),+ ).toBeVisible();await api(page, "post", `/career/workspace/${id}/submit`, { answers: [], expectedAnswers: [] });await api(page, "put", `/applications/${id}`, { laneId: referral.id });}