Repository navigation
viewer: storage origin follows the env, not the first stamp - #1191
Merged
Merged
Conversation
…ocess A texture stamped before NEXT_PUBLIC_SUPABASE_URL is read (the native texture tests from #1190, run first on Linux) pinned a null origin, so later storage URLs resolved to no reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
texture-referencecached the Pascal storage origin on its first read. When a texture was stamped beforeNEXT_PUBLIC_SUPABASE_URLwas set, the cache pinned a null origin for the whole process. The native-texture tests from #1190 stamp textures, and on Linuxmaterials.test.tsruns beforetexture-reference.test.ts, so 3texture-referencetests failed in private-editor's CI. The origin is now cached by the URL it was read from, so it follows the env.How to test
cd packages/viewer && bun test ./src/lib/materials.test.ts ./src/lib/texture-reference.test.ts: before this change, 3 fail; now 15 pass. The reverse order also passes.bun testinpackages/viewer: 913 pass.Screenshots / screen recording
N/A — non-visual change
Checklist
bun devbun checkto verify)mainbranch🤖 Generated with Claude Code
Note
Low Risk
Small cache invalidation change in texture URL classification; behavior improves when the Supabase URL is set after module use (mainly tests), with no auth or data-path impact.
Overview
Fixes flaky
texture-referencetests when another suite (e.g.materials.test.ts) stamps textures first in the same Bun process.pascalStorageOrigin()no longer caches a single origin forever on first use. It stores{ url, origin }from the currentNEXT_PUBLIC_SUPABASE_URLand re-reads the env when that value changes, so an early stamp with a missing env cannot locknullfor later tests that set the URL.The
texture-reference.test.tscomment is updated to describe env-driven caching instead of “set env before any stamp in this file.”Reviewed by Cursor Bugbot for commit 451c1fe. Bugbot is set up for automated code reviews on this repo. Configure here.