Skip to content

[bug] staging PWA manifest scope/start_url 硬編正式站網域,跨網域導致 staging 無法正確安裝 #612

Description

@s123104

摘要

staging(ratewise-staging.zeabur.app)的 manifest.webmanifestscopestart_url 為硬編的正式站絕對 URL(https://app.haotool.org/ratewise/),對 staging 網域而言是跨網域,導致 staging PWA 安裝行為異常(安裝入口指向正式站、manifest 與頁面 origin 不一致)。

背景/證據

  • 使用者於 staging PWA 實機回報 manifest 指向跨網域 URL。
  • 取證(2026-07-06):curl https://ratewise-staging.zeabur.app/ratewise/manifest.webmanifest 回傳 "scope": "https://app.haotool.org/ratewise/", "start_url": "https://app.haotool.org/ratewise/"
  • 來源:apps/ratewise/scripts/generate-manifest.mjs L40-44 以 APP_INFO.siteUrl(SSOT,正式站 URL)產生絕對 scope/start_url;註解明載為刻意設計(避免獨立 PWA partition + Chrome HTTPS-First 以 http 語意解析)。
  • <link rel="manifest"> href 本身走 __BASE_PATH__ 佔位符(相對於部署 base),無硬編問題;問題僅在 manifest 內容。

影響

  • staging 環境無法以 staging origin 完成 PWA 安裝驗證;QA 在 staging 裝出來的 PWA 實際指向正式站。
  • 正式站行為不受影響。

範圍

驗收標準

  • staging 部署的 manifest scope/start_url 與部署 origin 同源(相對路徑或依部署環境注入)
  • 正式站 manifest 維持絕對 HTTPS scope/start_url(保留原設計意圖)
  • verify:artifacts 與 manifest 相關測試全綠,PWA 安裝於兩環境皆驗證通過

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingseverity:p2Medium-priority work

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions