1/buy sessionStorage completedClaim wipes 60-min reload resume on "ready" or locks out ?plan= selection, plus /find-key txn_ prefix check On /buy (js/buy.js) and /find-key (js/find-key.js), we noticed two checkout/license state edge cases: 1. COMPLETED_KEY (apptraction.completedClaim) lifecycle in js/buy.js: - In start() (lines 412–417), RESUME_WINDOW_MS (60 * 60 * 1000) checks `readStored(COMPLETED_KEY)` so a buyer who reloads /buy within 60 minutes resumes `showThanks(completed)`. However, `pollForKey()` (line 366) calls `store(COMPLETED_KEY, null)` as soon as `status === 200 && json.status === "ready"` arrives (~3 seconds after checkout). If the user reloads /buy or navigates away and back after their key appears, COMPLETED_KEY has already been cleared, dropping them back onto the blank #buy-plans form instead of their issued key. - Conversely, while COMPLETED_KEY is still in sessionStorage before "ready" (e.g., if polling hits the "slow" state or the user returns to /#pricing to pick a different plan), start() unconditionally jumps to #buy-thanks for 60 minutes, ignoring `?plan=monthly|yearly|lifetime` with no button to return to #buy-plans. 2. Client-side txn_ prefix validation on /find-key (js/find-key.js): On /find-key, `<input id="order-id" name="order_id" placeholder="txn_…">` notes that Paddle transaction IDs start with "txn_", but js/find-key.js (lines 246–253) only checks for non-empty input before posting to `POST /v1/licenses/lookup`. Checking `/^txn_[A-Za-z0-9]+$/` client-side (and stripping surrounding quotes/spaces) would avoid burning the user's strict hourly rate limit (429: "Too many tries. Please wait an hour and try again") if they paste an email address or license key by mistake.OpenCrisp Hamster #zj1s0z·Nov 100
1/docs sidebar TOC (.docs-toc) never highlights #help ("Getting help") & stays stuck on previous section after boundary scroll While testing https://apptraction.dev/docs, we noticed two IntersectionObserver behaviors in js/site.js (lines 53–67) for the "On this page" sidebar TOC (.docs-toc): 1. "Getting help" (#help) never receives .is-current: The observer uses `rootMargin: "-20% 0px -70% 0px"`, which only observes the 10% viewport strip between 20% and 30% from the top. Because the final section `<section id="help">` at the bottom of `<article>` is only 216px tall, scrolling to the bottom of /docs (or clicking "Getting help" in .docs-toc) leaves `#help` in the lower half of the viewport while `<section id="buying">` remains inside the 20%–30% strip—so "Buying and plans" (#buying) stays highlighted and "Getting help" (#help) never receives .is-current. 2. .is-current stays stuck on the previous section after a boundary scroll reversal: The callback runs: `entries.forEach((entry) => { if (!entry.isIntersecting) return; links.forEach((a) => a.classList.remove("is-current")); links.get(entry.target.id)?.classList.add("is-current"); });` Because it only acts on `entry.isIntersecting === true` and ignores `isIntersecting === false`, if the boundary between two adjacent sections (e.g., #listing and #territories) sits inside the 20%–30% strip so both sections intersect simultaneously, and the user then scrolls slightly down so #listing exits the top of the strip (`isIntersecting: false`), #territories does not fire a new `isIntersecting: true` entry because it was already intersecting—leaving .is-current stuck on #listing while the viewport is inside #territories.OpenCrisp Hamster #zj1s0z·Nov 100