Skip to content

馃悶 Reuse ChatGPT PDF summaries to avoid duplicate Library uploads - #214

Open
JFWooten4 wants to merge 3 commits into
mainfrom
fix/reuse-chatgpt-summary-attachments-20261023
Open

JFWooten4 wants to merge 3 commits into
mainfrom
fix/reuse-chatgpt-summary-attachments-20261023

Conversation

@JFWooten4

@JFWooten4 JFWooten4 commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Problem

Every click of Summarize with ChatGPT sends a new attachment for the same PDF, creating (1), (2), and other duplicate Library entries.

Fix

  • Compute a SHA-256 digest of PDF contents (not a filename or URL) before selecting a destination.
  • On the first request, upload normally and remember the conversation URL after ChatGPT creates it.
  • On subsequent requests for identical PDF bytes, reopen that conversation with a new prompt without uploading again.
  • When an upload is still in progress, focus its existing tab instead of starting another.
  • Shift-click always starts a separate new chat and upload, leaving the saved reuse mapping untouched.
  • Do not reuse attachments for modified documents, and clear stale/failed in-progress mappings.

This reuses the existing conversation rather than automating ChatGPT's undocumented Library picker, and it does not delete previously created duplicates.

Reliable submission, including background tabs

  • Fill the summary prompt as soon as the ChatGPT composer is available, before receiving the PDF through the extension relay.
  • After the file input accepts the attachment, wait only for the attachment chip, not for upload progress indicators to disappear; then press Send and let ChatGPT queue processing until upload finishes.
  • Re-fill the composer if ChatGPT's editor is replaced during hydration, allow hidden tabs to submit without layout rects, and suspend wait timeouts when backgrounded.
  • Keep pending handoffs and conversation URL tracking available for up to ten minutes rather than silently failing after two minutes.
  • Add tests/chatgpt-summary-handoff.test.mjs covering pre-upload composition, sending with upload progress active, hidden tabs, hydration and reuse, plus a delayed-pending regression.

Verification

  • Reviewed generated Git tree to confirm all four intended files changed, parsed the modified JavaScript, and exercised mocked fresh, reused, pending, and Shift-click paths.
  • Added regression tests for those paths in tests/chatgpt-summary-popup.test.mjs.
  • GitHub Actions passed after the initial duplicate-attachment changes and after the early-submit changes. Final background-timeout follow-up CI is pending. A live ChatGPT end-to-end test remains unverified; the site's DOM and routing may change.

JFWooten4 and others added 3 commits October 23, 2026 10:31
Hash PDF contents before launching a summary, reopen an existing ChatGPT conversation for the same document, and focus in-progress handoffs instead of uploading again. Preserve Shift-click to start a separate new chat and add regression coverage for reuse, pending uploads, and fresh-chat overrides.

Co-authored-by: Codex Web <noreply@openai.com>
Populate the ChatGPT composer before transferring PDF bytes, permit sending as soon as the file is registered while its upload remains active, and recover composer contents after hydration. Keep background tabs eligible for submission and pause readiness timeouts while the page is inactive.

Add end-to-end content-script regression coverage for background submission, unfinished uploads, composer replacement, and conversation reuse.

Co-authored-by: Codex Web <noreply@openai.com>
Extend the in-progress PDF source relay and duplicate-upload guard to ten minutes so a slowly loading background ChatGPT tab does not lose its transfer. Keep conversation URL tracking alive for that window and cover refocusing an older pending upload in regression tests.

Co-authored-by: Codex Web <noreply@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant