Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache fallback on network failure #1161

Merged
merged 2 commits into from
Feb 12, 2025

Conversation

felddy
Copy link
Owner

@felddy felddy commented Feb 12, 2025

🗣 Description

The container will alway try to see if a newer (by timestamp) distribution for the current version of FoundryVTT exists. This is because newer distributions have been published in the past without bumping the version of FoundryVTT.

This PR will allow the container to fail back to the cache when there is a network failure while trying to fetch the latest release of FoundryVTT, or check the timestamp in the r2 bucket.

Some cases where this can happen are:

  • the FOUNDRY_RELEASE_URL is set to an expired timed URL.
  • the FOUNDRY_USERNAME or FOUNDRY_PASSWORD are invalid.
  • foundryvtt.com is down.
  • r2.foundryvtt.com is down.

Closes #212
Closes #1055

See:

💭 Motivation and context

It was annoying that a network failure didn't result in automatically failing back to the cache. Users had to
manually disable their credentials, or remove the timed URL.

🧪 Testing

Tested locally and in CI.

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All future TODOs are captured in issues, which are referenced
    in code comments.
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated
    to reflect the changes in this PR.
  • Tests have been added and/or modified to cover the changes in this PR.
  • All new and existing tests pass.

If a the fetch of the presigned URL fails try to use a cached version.
@felddy felddy force-pushed the improvement/cache_fallback branch from e240d7d to b6cbaa6 Compare February 12, 2025 23:29
@felddy felddy merged commit 124f72f into develop-prerelease Feb 12, 2025
45 checks passed
@felddy felddy deleted the improvement/cache_fallback branch February 12, 2025 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant