From 7bb27b6f9ac1d9a40e6326196401a3cc31468ed5 Mon Sep 17 00:00:00 2001 From: Dave Date: Wed, 10 Jun 2026 22:10:51 -0400 Subject: [PATCH] Fix missing guns on gear page caused by CDN-poisoned manifest shards Cloudflare cached April-era inventoryitem shards 4-7 under the current ?v= URL during the June 10 deploy: requests arrived mid-rsync while the origin still had the old files, and the 30-day max-age locked the stale mix in place. Any item landing in shards 4-7 of the new manifest (e.g. Someday, hash 3232203524) failed getInventoryItem and was dropped from the gear page. Clients also persisted the bad mix into IndexedDB keyed by manifest version. - Suffix package.json "manifest" with -r2 so clients fetch fresh URLs (new Cloudflare cache key) and re-download into a fresh IndexedDB key; the value is only ever used as a cache key - Deploy in two rsync phases (assets first, index.html + --delete second) so clients can never request new ?v= URLs before the files behind them are fully uploaded - Document new-workspace setup (npm install, manifest:fetch) and the manifest:fetch clobber gotcha in CLAUDE.md Co-Authored-By: Claude Fable 5 --- .github/workflows/beta-deploy.yml | 6 ++++++ .github/workflows/deploy.yml | 9 +++++++++ CLAUDE.md | 9 +++++++++ package.json | 4 ++-- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/beta-deploy.yml b/.github/workflows/beta-deploy.yml index 89d8356c..76596b73 100644 --- a/.github/workflows/beta-deploy.yml +++ b/.github/workflows/beta-deploy.yml @@ -43,6 +43,12 @@ jobs: mkdir -p ~/.ssh echo "$SSH_KEY" > ~/.ssh/deploy_key chmod 600 ~/.ssh/deploy_key + # Two-phase deploy, same as deploy.yml: upload assets first so clients + # never see the new index.html before the files it references exist. + rsync -avz --exclude=index.html \ + -e "ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=no -p ${{ secrets.BETA_PORT }}" \ + ./dist/browser/ \ + ${{ secrets.BETA_UID }}@${{ secrets.BETA_HOST }}:/home/${{ secrets.BETA_UID }}/d2checklist-beta/ rsync -avz --delete \ -e "ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=no -p ${{ secrets.BETA_PORT }}" \ ./dist/browser/ \ diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 82dacd41..0a93da48 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -44,6 +44,15 @@ jobs: mkdir -p ~/.ssh echo "$SSH_KEY" > ~/.ssh/deploy_key chmod 600 ~/.ssh/deploy_key + # Two-phase deploy so clients never load the new index.html (and the new + # ?v= asset URLs baked into it) before every asset it references is fully + # uploaded. A request for a new-versioned URL mid-upload returns the OLD + # file, which Cloudflare then caches for 30 days under the NEW cache key, + # poisoning the manifest for every client (see missing-guns bug, Jun 2026). + rsync -avz --exclude=index.html \ + -e "ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=no -p ${{ secrets.PORT }}" \ + ./dist/browser/ \ + ${{ secrets.UID }}@${{ secrets.HOST }}:/home/${{ secrets.UID }}/d2checklist/ rsync -avz --delete \ -e "ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=no -p ${{ secrets.PORT }}" \ ./dist/browser/ \ diff --git a/CLAUDE.md b/CLAUDE.md index d8c9d141..07683c93 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -24,6 +24,15 @@ New workspaces/worktrees are missing the gitignored `src/environments/keys.ts` a cp ~/projects/d2-checklist/src/environments/keys.ts ~/projects/d2-checklist/src/environments/keys-prod.ts src/environments/ ``` +New workspaces are also missing node_modules and the gitignored manifest JSON in `src/assets/` (`destiny2-*.json`), so after copying the keys run: + +```bash +npm install +npm run manifest:fetch # downloads the Bungie manifest and generates src/assets/destiny2-*.json +``` + +Note: when `manifest:fetch` downloads a new manifest it rewrites package.json's "manifest" value to the raw Bungie version string, which will clobber any cache-busting suffix (e.g. `-r2`) that was added intentionally — re-check package.json after running it. + ## Project structure - `src/app/` - Angular application source diff --git a/package.json b/package.json index 15155dde..af3ee97e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "d2-checklist", - "version": "32.0.1", - "manifest": "244019.26.05.29.1640-4-bnet.65312", + "version": "32.0.2", + "manifest": "244019.26.05.29.1640-4-bnet.65312-r2", "license": "MIT", "scripts": { "ng": "ng",