Conversation
Both deploy workflows set NEXT_PUBLIC_BASE_URL, but nothing read it, so samples copied from datapipe-test.web.app fell through to the packages' built-in pipe.jspsych.org and wrote to production. The API reference printed the production origin too. lib/base-url.js now reads it, with production as the fallback. The API reference uses it, and on any non-production build every sample passes the deployment explicitly (base_url for the extension, baseURL for datapipe-client). Production samples are unchanged. Fixes #246 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Point the test site's code samples at the test site
- Reject experiment IDs Firestore can't store (e.g. an unfilled "__DATAPIPE_STUDY1_ID__" placeholder) with the normal not-found response. Firestore throws on these instead of missing, so /api/data answered with a 500. - Log the provider error when createexperiment returns a 502, so the failure is visible in Cloud Logging and not only in the browser. - Check the HTTP status in OSF listFiles. An OSF error response crashed with "Cannot read properties of undefined (reading 'filter')", which hid OSF's real status and failed uploads permanently through the collision cache. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
getExperiment() returns null for a missing experiment and for an id Firestore would reject outright, so every endpoint that looks an experiment up by a client-supplied id keeps a single not-found branch and none can reach the doc() call that throws. This replaces the guard copied into six handlers and extends the fix to clear-errors and ensure-derived-paths, which still returned 500s. - api-queue-status checks its `download` queue-entry id the same way (404 instead of a 500 on "__x__" or "a/b"). - writeLog skips ids Firestore would reject, rather than every caller avoiding it on a comment that said it would throw (it never did). - create-experiment logs the Error object and the uid on a 502. - OSF listFiles errors carry OSF's own errors[0].detail, falling back to statusText. - Emulator coverage now includes session start, finalize, clear-errors, ensure-derived-paths and queue-status (experimentID and download). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Return clear errors instead of crashes on three production failure paths
validateStaticToken collapsed every non-200 into "invalid", and the connect endpoint turns that into "Invalid API token" without logging anything. A real 401, a firewall 403, and an outage 5xx looked the same after the fact, which left #278 undiagnosable. Log the server, status, and a truncated, token-scrubbed body so the next failure says why. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ogging Log why a Dataverse server rejected a token at connect
…logs validateStaticToken read the whole non-200 body with response.text() from a researcher-chosen server, so a hostile or slow-dripping installation could exhaust dashboardapi's shared memory. It now reads at most 4KB for at most 5s, then drops the connection, and flattens the logged body to one line. createExperimentHandler logged the raw provider Error, but a Dataverse installation can echo the API key in its error text. The logged stack is now scrubbed with the same redaction validateStaticToken uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cap Dataverse token-check body read; scrub tokens from create-experiment logs
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.
No description provided.