Skip to content

Fix resume preview failing to load in the browser - #378

Open
github-actions[bot] wants to merge 2 commits into
mainfrom
hotfix-fix-main-review-issues-9d3d
Open

Fix resume preview failing to load in the browser#378
github-actions[bot] wants to merge 2 commits into
mainfrom
hotfix-fix-main-review-issues-9d3d

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Automated PR tracking changes from hotfix-fix-main-review-issues-9d3d into dev.


Note

Medium Risk
Relaxes framing/CSP (SAMEORIGIN, blob:) site-wide via proxy and next.config, and changes resume storage from re-encoded PDFs to originals—preview fixes are solid but header policy shifts warrant a quick smoke test on payments and other embedded frames.

Overview
Fixes broken inline resume previews on settings and admin resume book by no longer framing /api/resume directly. A new ResumePreview component fetches the PDF, validates bytes, builds a application/pdf blob URL, and loads that in an iframe—with loading and error states plus a fallback “open in new tab” link. Admin and member UIs also get explicit Open links to the resume API.

Upload behavior changes: the API still uses pdf-lib to reject unreadable PDFs, but it stores the original file bytes instead of re-saving through pdf-lib (which was shrinking some resumes but corrupting others with forms/fonts).

Security headers are aligned with previews: edge X-Frame-Options moves from DENY to SAMEORIGIN, and CSP adds blob: to frame-src and relaxes object-src to 'self' blob: so Chrome’s PDF viewer works when CSP enforcement is turned on.

Reviewed by Cursor Bugbot for commit d140df2. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.


const result = row[0] ?? null;
ctx.cache.set(cacheKey, result, 60);
return result;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing resume is never cached

Low Severity

resume.me stores a missing row as null, but cache.get also returns null on a miss, so cached !== null never treats “no resume” as a hit. Every profile load for a member without a resume repeats the lookup. The same commit caches an absent project-leader row as false to avoid this trap.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e3ed7d8. Configure here.

@cursor
cursor Bot force-pushed the hotfix-fix-main-review-issues-9d3d branch from e3ed7d8 to e3b1640 Compare September 6, 2026 22:13
@cursor cursor Bot changed the title Feature: hotfix-fix-main-review-issues-9d3d to dev Fix resume book, analytics, and volunteer-admin bugs Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Visit the preview URL for this PR (updated for commit d140df2):

https://hacklytics2027--pr-378-idyywqzy.web.app

(expires Mon, 14 Sep 2026 17:51:52 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: c48ba34db61581e25fe2978355160b5eefe0e83f

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

.values(values)
.returning({ id: S.initiatives.id });

return created.id;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seed resets live project leadership

Medium Severity

Re-running db:seed:club-projects updates existing initiative rows by title and always writes leaderUserId back to OWNER_EMAIL and status to open. The club-project docs present that command as a safe republish that never deletes. A second run after real leads have taken over reassigns ownership and reopens closed projects.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e3b1640. Configure here.

The edge proxy sent X-Frame-Options: DENY on /api/resume, so Chrome's PDF viewer reported a failed load for a file that was already on disk. Preview now fetches the PDF as a blob, and uploads keep the original bytes instead of a pdf-lib rewrite that can corrupt real resumes.

Co-authored-by: Aamogh <aamoghS@users.noreply.github.com>
@cursor
cursor Bot changed the base branch from dev to main September 7, 2026 17:47
Force the blob to application/pdf, reject non-PDF bodies, and add an
Open-in-new-tab path so Chrome's viewer is not the only way to see a
stored resume.

Co-authored-by: Aamogh <aamoghS@users.noreply.github.com>
@cursor cursor Bot changed the title Fix resume book, analytics, and volunteer-admin bugs Fix resume preview failing to load in the browser Sep 7, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

There are 3 total unresolved issues (including 2 from previous reviews).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d140df2. Configure here.

className="w-full h-[70vh] min-h-[420px] rounded-sm border border-[var(--border-subtle)] bg-[var(--bg-secondary)]"
/>
)}
{preview && <ResumePreview src="/api/resume/me" title="Your resume" />}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale resume preview after replace

Medium Severity

ResumePreview snapshots /api/resume/me into a blob and only refetches when src changes. Replacing a resume while preview is open invalidates metadata (name, size, date) but leaves src unchanged, so the framed blob stays the previous file. The settings UI then shows the new upload next to the old PDF.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d140df2. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant