MVA Global Fret static HTML site (mirror of GitHub MVA-Global-Fret/site-mva-global-fret) � deployed to VPS Falkenstein for mva-globalfret.com
Go to file
Serge RAKOTO HARRY-NAIVO dd23a46603 chore: post-review cleanup (3 Important fixes + dead code purge)
Addresses the 3 Important issues + 4 follow-ups flagged by the
final code review subagent.

## Important fixes

- **getNextRef pagination** (cloudflare-worker/hubspot-proxy.js):
  previously used HubSpot search with limit:100 without pagination,
  causing reference-number collisions once contact count exceeded
  100 (= search results don't guarantee ordering by ref). Now
  paginates through all results via paging.next.after cursor to
  find the true numeric maximum. ~10 API calls for 1000 contacts.

- **Turnstile reset after Worker calls** (js/form-handler.js):
  Cloudflare Turnstile tokens are single-use server-side. Without
  explicit reset, a re-submit would 403 silently from siteverify.
  New helper resetTurnstile() clears window.turnstileToken and
  calls window.turnstile.reset() to force a fresh challenge. Called
  after both requestVerification and sendWelcomeBack flows.

- **notifyDuplicateViaFormspree removed** (js/form-handler.js):
  was actively POSTing returning customers' name+email to Formspree
  (FORMSPREE_ID='mojrvokp' = real endpoint, sentinel guard never
  triggered). PII leak to a third-party service inconsistent with
  the new Resend-only architecture. Function + call site removed.

## Dead code purge

- form-handler.js: removed generateRefNumber (= dead, no callers),
  submitToHubSpot, submitToFormspree, notifyDuplicateViaFormspree
  functions. Removed constants HUBSPOT_PORTAL_ID, HUBSPOT_FORM_GUID,
  FORMSPREE_ID, EMAILJS_PUBLIC_KEY, EMAILJS_SERVICE_ID,
  EMAILJS_TEMPLATE_ID, EMAILJS_TEMPLATE_WELCOME_BACK. Removed
  emailjs.init() block. Net -111 lines.

- contact.html + confirmation.html: removed <script> tag loading
  EmailJS browser SDK from jsDelivr (~30KB gzipped per page).

- cloudflare-worker/hubspot-proxy.js: removed unused HUBSPOT_PORTAL_ID
  + HUBSPOT_FORM_GUID constants. Removed listSubscriptions and
  subscribe action handlers (= 0 callers in frontend, debug-only,
  reachable by unauthenticated POST without Turnstile guard).

- cloudflare-worker/DEPLOIEMENT.md: KV ID note updated to reflect
  the actual ID in wrangler.toml.

## Net diff

-116 lines (= 92 added, 208 removed across 4 files).

Refs: post-cutover polish, addresses code review 2026-05-07.
2026-05-07 17:36:25 +02:00
.claude Swap colorkey'd cloud for Microsoft Fluent 3D cloud emoji 2026-05-05 01:50:44 +02:00
.github/workflows Add Actions-based Pages deploy workflow 2026-05-05 17:05:13 +02:00
assets Switch parcel sprites to a real 3D parachute GLB with bound cargo 2026-05-05 13:32:48 +02:00
cloudflare-worker chore: post-review cleanup (3 Important fixes + dead code purge) 2026-05-07 17:36:25 +02:00
css Service Commande: redesign 'Et le transport ?' card 2026-05-06 08:40:14 +02:00
images feat(images): self-host hero photos from Unsplash (#1) 2026-05-07 01:01:54 +03:00
js chore: post-review cleanup (3 Important fixes + dead code purge) 2026-05-07 17:36:25 +02:00
.gitignore Initial commit — Site MVA Global Fret 2026-05-02 22:23:48 +02:00
about.html chore(post-cutover): fix 3 polish bugs (welcome-back, mobile lang switcher, animate-on-scroll) (#6) 2026-05-07 16:36:28 +03:00
accueil.html chore(post-cutover): fix 3 polish bugs (welcome-back, mobile lang switcher, animate-on-scroll) (#6) 2026-05-07 16:36:28 +03:00
application.html chore(post-cutover): fix 3 polish bugs (welcome-back, mobile lang switcher, animate-on-scroll) (#6) 2026-05-07 16:36:28 +03:00
cgv.html chore(post-cutover): fix 3 polish bugs (welcome-back, mobile lang switcher, animate-on-scroll) (#6) 2026-05-07 16:36:28 +03:00
confirmation.html chore: post-review cleanup (3 Important fixes + dead code purge) 2026-05-07 17:36:25 +02:00
contact.html chore: post-review cleanup (3 Important fixes + dead code purge) 2026-05-07 17:36:25 +02:00
guide-envoi.html chore(post-cutover): fix 3 polish bugs (welcome-back, mobile lang switcher, animate-on-scroll) (#6) 2026-05-07 16:36:28 +03:00
index.html Switch parcel sprites to a real 3D parachute GLB with bound cargo 2026-05-05 13:32:48 +02:00
mentions-legales.html chore(post-cutover): fix 3 polish bugs (welcome-back, mobile lang switcher, animate-on-scroll) (#6) 2026-05-07 16:36:28 +03:00
PNG MVA GLOBAL FRET.png Initial commit — Site MVA Global Fret 2026-05-02 22:23:48 +02:00
politique-confidentialite.html chore(post-cutover): fix 3 polish bugs (welcome-back, mobile lang switcher, animate-on-scroll) (#6) 2026-05-07 16:36:28 +03:00
reset-password.html feat(seo): sitemap + robots.txt + mobile reset-password bridge (#2) 2026-05-07 01:04:05 +03:00
robots.txt feat(seo): sitemap + robots.txt + mobile reset-password bridge (#2) 2026-05-07 01:04:05 +03:00
service-commande.html chore(post-cutover): fix 3 polish bugs (welcome-back, mobile lang switcher, animate-on-scroll) (#6) 2026-05-07 16:36:28 +03:00
sitemap.xml feat(seo): sitemap + robots.txt + mobile reset-password bridge (#2) 2026-05-07 01:04:05 +03:00
tarifs.html chore(post-cutover): fix 3 polish bugs (welcome-back, mobile lang switcher, animate-on-scroll) (#6) 2026-05-07 16:36:28 +03:00