Skip to content

[bug] Service worker tile-cache check targets a stale hostname #66

Description

@AnayDhawan

What happened?

public/sw.js's tile-cache branch checks
url.hostname.endsWith("tile.openstreetmap.org") to decide whether to
cache-first a map tile request for offline use. This predates the CARTO
basemap migration — CARTO tiles (basemaps.cartocdn.com) now fall through
this check entirely, hit the cross-origin early-return a few lines below,
and are never cached.

What did you expect to happen?

Offline tile caching (the whole point of this service-worker branch, per
its own comment: "so the map still opens on exam day with a weak or absent
signal") should actually cache the tile provider currently in use.

Steps to reproduce

  1. Read public/sw.js's fetch handler.
  2. Compare the hostname check against the actual tile URL in
    src/components/map/map-view.tsx (basemaps.cartocdn.com, or
    MapTiler's host once that migration lands).

Browser and OS

No response

Checklist

  • I searched existing issues and this is not a duplicate.
  • This is not a security vulnerability (those go to studentsuite0@gmail.com).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions