Skip to content

fix: SW cache URL paths, dapp name sanitisation, inbox version#13

Merged
eurobuddha merged 1 commit intomasterfrom
fix/sw-url-paths-and-naming
Mar 23, 2026
Merged

fix: SW cache URL paths, dapp name sanitisation, inbox version#13
eurobuddha merged 1 commit intomasterfrom
fix/sw-url-paths-and-naming

Conversation

@eurobuddha
Copy link
Copy Markdown
Owner

Summary

Three fixes identified by code review:

  • sw.js: Precache URLs now resolved relative to self.location using BASE = new URL('./', self.location).href. Previous bare paths (/style.css) were stored as origin-root URLs and never matched Minima's path-prefixed requests (/minidapps/0x.../style.css) — the entire precache was silently providing zero benefit. Also simplified NETWORK_ONLY check to filename matching (split('/').pop()) which is path-prefix agnostic.

  • studio-builder.js: safeName() now applied to shopName before writing to dapp.conf name field. Minima constrains this field — special characters could cause node registration to fail. The headline field retains the full unsanitised display name.

  • studio-builder.js: Inline INBOX_CONFIG version string bumped 1.0.01.1.0 to match the rest of the release.

Test plan

  • Install shop on Minima node — confirm assets load from cache (check Network tab, should show (ServiceWorker) for static assets)
  • Confirm config.js and products.js always hit the network
  • Create a shop with special characters in the name (e.g. My Shop (Beta)) — confirm it installs successfully on Minima node

🤖 Generated with Claude Code

- sw.js: resolve all precache URLs relative to self.location (BASE)
  so cache keys match Minima's path-prefixed URLs
  (e.g. /minidapps/0x1a2b.../style.css). Old bare-path keys
  (/style.css) never matched prefixed requests — entire precache
  was silently inert. Also simplify NETWORK_ONLY check to use
  filename matching instead of pathname.endsWith().

- studio-builder.js: apply safeName() to shopName before writing
  to dapp.conf name field. Minima constrains this field to
  alphanumeric/hyphens/spaces — unsanitised names with special
  chars could cause node registration to fail. headline keeps
  the full display name.

- studio-builder.js: bump inline INBOX_CONFIG version 1.0.0 → 1.1.0
  to match the rest of the 1.1.0 release.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@eurobuddha eurobuddha merged commit 43c6cb5 into master Mar 23, 2026
5 checks passed
@eurobuddha eurobuddha deleted the fix/sw-url-paths-and-naming branch March 23, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant