A file reference is an id, and the address is this side's to build - #106
Merged
Conversation
Four answers named a file by where to fetch it, relative to the Server's own origin — so a figure in a statement asked the application for its bytes and was answered with the single-page shell. The renderer takes an address rather than a reference, because a stored file, one staged in an editor and the mark this application ships with are three different answers to the same question.
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.
After importing the demonstration bundle, the figures in four problem statements
did not display. Neither the export nor the import was at fault — the archive's
PNGs are real, their checksums match, they are
scope: participant, and eachstatement references one by bare name exactly as
content/reference.tswritesand
ContentViewresolves.The Server published
/api/v1/files/<id>, relative to its own origin, andthis side put it into
<img src>verbatim. Served from anywhere else, thebrowser asked the application for the bytes and got the single-page shell.
AlgoJudge/AlgoJudge-Server#97stops sending an address. This reads the id.What changes
Attachment,ProblemFile,InstanceLogoandInstanceFontcarryfileIdand no
url. Every consumer joins it itself —fileApi.url(f.fileId), which isabsolute because
baseUrlcarries the API's origin — and hands the result to theDOM. No proxy, in Vite or anywhere else.
The renderer takes an address rather than a reference.
ReferencedFileincontent/reference.tsis{ name, mimeType, address }, because a stored file,one staged in the editor and unpublished, and the mark this application ships
with are three answers to one question. They were being spelled
url ?? "#"anda placeholder.
The export stops reading an address.
collect.tssaid in its own commentthat it wanted to go through
fileApiand could not, because the DTO publishedan address and no id. It does now — and compares the checksum at the fetch.
Before, a relative address reached the application, the SPA shell came back with
response.ok === true, and the HTML was bundled as the file's bytes; thefailure surfaced at somebody else's import as "the archive is damaged".
Two things the fake could not show
"#". No figure had ever rendered in anybrowser check, so this class of defect was structurally invisible here.
FakeFiles.seedBytesseeds a real one-pixel PNG and the figure draws.threw "has not been stored". It carries its
fileIdnow.Verification
lint (silent),
lint:deps, typecheck, build,check:i18n,check:content,check:exchange,check:ranking, andcheck:ui.verify-exchangereddened once and it was mine: the export goes throughfileApinow, the fake sleeps 200 ms per call by design, and the script's fixedfour-second wait was landing inside that. It waits for the archive instead,
which is what
scripts/verify/README.mdprescribes.sign-in-redirectfails in any checkout carrying a.envwithVITE_APP_API_BASE_URL— the provider challenge is built from that origin andthe redirect leaves for a Server the fake run has not got. Confirmed unrelated:
it passes with the variable unset, and CI has no
.env.Measured on a live stack. The bundle imported through the manager's import
screen; all four figures
200 image/pngwith decoded widths 1280, 1070, 1260,1184. Measured again on the production topology — a page on
algojudge.test,images from
api.algojudge.test— and all four drew there too, theSameSite=Laxsession cookie riding along because the two share a registrabledomain.