Deleted Snippet content still injected into served index.html after fresh deployment

Aperta
#1,812 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
angular, azure, github-actions, nodejs
Ambito
cloud, devops, web-dev

Direzione di ricerca

Start with the Microsoft.Web/staticSites/snippets Management API responses and the Azure Static Web Apps deployment flow using Azure/static-web-apps-deploy@v1 and Oryx. Compare the locally built clean index.html with the served response after a fresh deployment, and trace where snippet injection occurs. Done means a deleted snippet confirmed absent by the API is no longer injected into the deployed index.html.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Description

A Microsoft.Web/staticSites/snippets entry that has been deleted (confirmed via the Management API returning an empty value: [] list) continues to be injected into the served index.html, and survives a subsequent fresh deployment.

More surprisingly, the content still being injected does not match either of the (now-deleted) snippets we could account for — it appears to be an even older snippet version that neither of us could find a record of, suggesting the injection layer is reading from a cache/replica that is either very stale or not being invalidated correctly across edits, rather than a simple few-minutes propagation delay.

Steps to reproduce

  1. Add a Snippet via the portal (location: Head, insert at bottom) that injects a <script> tag.
  2. Deploy the app; confirm the snippet appears in the served HTML.
  3. Delete the snippet (portal or DELETE .../staticSites/{name}/snippets/{name}?api-version=2022-03-01).
  4. Confirm via GET .../staticSites/{name}/snippets?api-version=2022-03-01 that the snippets list is now empty.
  5. Trigger a fresh deployment (new commit, new build, new artifact — confirmed via a locally-reproduced ng build producing a clean index.html with no trace of any snippet).
  6. Request the site's index.html — the old snippet's script is still present, injected in the same location/format as before.

Expected behavior

Once a snippet is deleted and confirmed absent from the Management API, a fresh deployment should serve index.html without any snippet injected.

Actual behavior

The served index.html still contains an injected <script> block at the expected snippet insertion point (end of <head>), even though:

  • The snippets list API returns [] for the site.
  • The locally-built artifact (same source, same build command run outside of Azure's pipeline) is confirmed byte-for-byte clean apart from this one injected block.
  • ETag/Last-Modified on the served response update with each new deployment, confirming it isn't a simple HTTP/CDN cache.
  • The injected content doesn't match the text of the last known snippets we had configured, suggesting it may be an older, previously-deleted snippet resurfacing rather than the most recently deleted one.

Environment

  • Static Web Apps (Standard plan)
  • Deployment via GitHub Actions using Azure/static-web-apps-deploy@v1, Oryx build (Node 22, Angular app)
  • Snippets configured via the Microsoft.Web/staticSites/snippets ARM resource, api-version=2022-03-01

Happy to provide more detail (redacted resource names/ids) if useful for investigation.

Lingua principale
Nessun dato sulla lingua
Stelle
347
Fork
68
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Azure/static-web-apps

Tutte le issue di Azure/static-web-apps

Issue simili

Altre issue su Cloud

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.