Skip to content

Godot plugin: fetch and cache the feed, with an offline fallback #279

Closed

Description

@TMHSDigital

Summary

Load the catalog into the plugin: fetch the plugin feed, cache it, and keep working offline.

Depends on #277 (the feed) and #278 (the skeleton).

Suggested approach

  • An HTTPRequest node for https://tmhsdigital.github.io/Free-Game-Dev-Assets/plugin-feed.json.
  • Cache the body and its ETag / Last-Modified under the editor's cache folder (EditorPaths.get_cache_dir()), not in the user's project. Send If-None-Match on the next fetch, and treat 304 as "use the cache".
  • Refresh at most once a day on its own, plus a manual Refresh button.
  • Offline or failed fetch: show the cached data with "offline, data from vYYYY.MM.DD". With no cache at all, show a clear message and a Retry button.
  • format newer than the plugin knows: use the cache if there is one, otherwise show "update the plugin". Never crash on unknown keys; ignore them.
  • Parse with JSON.parse_string and check the types of the fields actually used.
  • Put the parsing in a separate script with no node or scene dependencies, so it can be unit tested (Godot plugin: unit and smoke tests in CI against a fixture feed #283).

Acceptance criteria

  • First open fetches and shows "N entries, data from vYYYY.MM.DD"
  • A second open within a day makes no request. Refresh sends a conditional request.
  • With networking off, cached data still shows; with no cache, a message and Retry show
  • A feed with format set higher than supported is handled as described above
  • The editor never freezes: everything is async, with a timeout

Part of #116. Effort: M. audit-key: enhancement|godot-plugin|feed-cache

Activity

  1. added
    help wanted
    priority: low
    feature
    godot-plugin
    on Nov 10, 2026
  2. TMHSDigital commented on Nov 10, 2026

    @TMHSDigital
    OwnerAuthor

    Done in TMHSDigital/free-game-dev-assets-godot@7049d87.

    • feed.gd parses and checks the feed:
      • a newer format gets an "update the plugin" message
      • malformed entries are dropped and unknown keys ignored
      • parsing is quiet, so a Wi-Fi login page answering 200 with HTML doesn't print an engine error
    • feed_cache.gd keeps the last good feed, its ETag and its Last-Modified in the editor's cache folder, never in the project. A new copy replaces the old one only once it is fully written.
    • feed_client.gd uses the cache when it is under a day old. Otherwise it sends a conditional request, and a 304 keeps the cache. When offline, on a 5xx, or on a too-new feed, it falls back to the cache and says why. With no cache it shows the reason, and the button reads Retry.
    • The dock shows "N entries, data from vYYYY.MM.DD" with a Refresh button.

    Verified:

    • tests/run_tests.gd: 50 headless checks against a fixture feed, covering 200, 304, offline, timeout, 503 and too-new, with and without a cache. No network.
    • Real editor run on Godot 4.7.1: fetched the live feed (302 KB) and wrote the cache. A second run within a day made no request.
    • GitHub Pages answers the stored validators with 304.
    • Godot 4.3 is still unverified; that falls to Godot plugin: unit and smoke tests in CI against a fixture feed #283.
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

    featuregodot-pluginhelp wantedpriority: low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions