You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fsl logs --all reads every line of the service. By default a cloud query now reads only the entries fsl wrote (see Changed); --all leaves that out, for a failure where fsl wrote nothing: out of memory, a crash at startup. It cannot be combined with --local.
fsl logs and fsl logs attachments sign in with a key file. Name it in GOOGLE_APPLICATION_CREDENTIALS (a .env.local is loaded). fsl hands it to its own gcloud process as CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE and leaves the person's gcloud login alone. A machine that already sets GOOGLE_APPLICATION_CREDENTIALS for another purpose now has fsl logs use that key. With a key file named, nothing falls back to the personal login; a permission failure names the variable and the role (roles/logging.viewer, or read access to the bucket for attachments), and a sign-in failure with no key file names the key-file way.
fsl doctor reports where it found the backend.--json has one new field, setup.backendFrom: "flag", "firebase.json", "search" or null. The Setup line adds "(found by search)" to a backend that the search found, so a person can see the deduction and correct it with --backend.
enableActions() records marked user actions. From @dasasian/firebase-structured-logger/client/actions, an element marked data-fsl-action="apply_discount" becomes an action breadcrumb on click, submit (<form>) or change (<select>, <input>, <textarea>), with no code per handler, so it also tells repeats apart by path.
Changed
Every deprecated name has its own Mistakes line in CAPABILITIES.md, with its replacement, and a test fails when one has none.ClientLogRequest had no line. Six renamed options shared one line in one section, and the lines for bc.nav and setScreen named no replacement. Each name now has a line in the section of the code that takes it, with the replacement the run-time warning names, so /fsl-review finds it where it reads. The test takes the names from the list the deprecation tests use.
The backend writes the local log file in development on any server, and never in a test run. An app that passes logLocalDir to the /functionsinitLogger and runs off Cloud Functions, started with tsx watch or node on a developer's machine, gets dev.jsonl there, and fsl logs --local reads it. The file is written when K_SERVICE is unset and NODE_ENV is neither production nor test: Jest and Vitest set NODE_ENV=test, so a test run writes no file and makes no folder. A test runner that sets no NODE_ENV (Mocha, node --test) needs NODE_ENV=test in the test script. What the process prints does not change. A live server off Google Cloud that never sets NODE_ENV=production writes the file too, bounded by the record and rotation limits. Nothing changes for an app on Cloud Functions or in the emulator.
fsl logs reads the entries fsl wrote. The Cloud Logging filter asks for entries that carry the appId label, for the query, schema and --repeats, so a service's own request lines no longer fill the 5000-entry scan. Pass --all to read every line. A cloud query that finds nothing says on stderr that --all also reads lines fsl did not write.
A word fsl logs does not know is an error.fsl logs --local schema used to run a plain query and print "0 entries matched"; it now exits 1 and shows fsl logs schema --local. Any other stray word exits 1 and names the two sub-commands. schema and attachments refuse a stray word too.
A key file that is not there is an error in fsl upload-sourcemaps.FIREBASE_SERVICE_ACCOUNT_PATH naming a missing file used to upload with the personal application-default login without a word. It now exits 1, names the variable and the path, and sends nothing. GOOGLE_APPLICATION_CREDENTIALS is read the same way.
fsl doctor finds the backend by flag, then the functions key of firebase.json, then a search. The search looks at the project root and each folder one level down whose package.json lists this package, drops a folder that holds a web build, and answers only when the web build is known and one folder is left. With none left the backend is not checked; with several, or with one and no known web build, doctor reports could-not-check naming the folders and the flags to pass. --backend and --dist now work next to a firebase.json. A project whose firebase.json has a functions key gets the same report as before, plus backendFrom.
/fsl-review and /fsl-logs run the fsl of the installed package by its path.npx fsl in a folder with no install reaches for another author's package named fsl. /fsl-review looks one level down when the project root has no install.
createClientLogFunction() and createClientLogHandler() take no argument when every default fits. The config was a required parameter, so the shortest correct call was createClientLogFunction({}). A call with a config works as before.
The docs moved to https://fsl.dasasian.com/. The README is now a front page with a quick start and a map of the docs, and the npm homepage points at the site.
withLogging logs what the handler throws, then throws it again. After the upgrade an app gets new entries: every throw out of a wrapped handler is logged with the request's functionName, userId and labels, and the caller, the schedule or the task queue gets the same value as before. A handler needs no try/catch only to log; an error already given to logError is not logged twice. A plain Error or an error with a status of 500 or more is an ERROR; an HttpsError with a 4xx code is a WARNING with its code and status and no stack. A plain Error from a callable now shows as two ERROR entries: fsl's, with the labels, and Firebase's own Unhandled error.
Repeats are told apart by the user's last actions on the screen. An error's repeat signature now includes the names of the last 3 bc.action breadcrumbs since the last navigation, so the same error reached by two different paths on one screen gets its own full copies and its own summary. An app with no action breadcrumbs gets the signature it always had.
/fsl-review proposes by user flow when a capability fits many places, and asks which flows matter. Past about ten places it groups them by what the user is trying to do, gives the count for each flow, names the flow it would do first, and ends with one question. CAPABILITIES.md says which controls to mark first: payment, sign-in and saving work. The review still proposes and stops.
/fsl-review lists what the code has before it decides, says what it read, and reads comments before it proposes a removal. The review lists each component file and each block rendered on a condition, then decides for each which capability covers it, or none; the words in "Fits when" are no longer the limit of the search. The proposal says in one line how many files were read and the kinds of place looked for. When the code says why a line is there, the proposal gives both sides and does not call its removal a fix.
CAPABILITIES.md knows more places for screens and views. Pages without a URL change fit a Vue v-if / v-else-if / v-else chain and a React tree swapped by early returns on auth or gate state. Views fit role="menu", role="alertdialog", <Teleport, createPortal( and hand-made overlays; the section says to mark dialogs, overlays and the layout mode first, and warns against marking regions that are always visible together.
The browser logger adds an error breadcrumb for every error that reaches it. Its name is the entry's errorType and it has no data. It is added whether the rate limiter sends the error, counts it as a duplicate or refuses it, and not again while the newest breadcrumb is an error with the same name. The trail of every later entry, feedback included, now shows the errors that reached the logger before it, with no code in the app; the entry's own trail does not hold its own. A repeat summary, feedback and entries with no error add none. After the upgrade, trails hold error breadcrumbs the app did not add, and an app that added its own bc.handledError( next to logger.error( gets two until it removes its line.
Deprecated
FIREBASE_SERVICE_ACCOUNT_PATH. Use GOOGLE_APPLICATION_CREDENTIALS, with the same path. The old name still works, warns once, wins when both are set, and is removed in 2.0.
Removed
sendPendingSummaries() is gone from the client logger's type. It was never documented, and a call from an app sent nothing useful. fsl sends repeat summaries itself: once after initLogger, hourly, and when the tab is hidden. No code change is needed in an app.
Fixed
The rate limiter limits where browser storage fails. With no sessionStorage or localStorage (a private window, a sandboxed iframe, an app's tests in Node with no DOM), or storage that throws on a read or a write (a full quota), each log started from a fresh budget: the same error twenty times sent twenty entries, where a working browser sends three and counts the rest. From the first read or write that fails, that store's state (the budget and duplicate counts, or the summary queue) now lives in memory for the rest of the page load; a reload loses it. A working storage is used as before, and resetSession() clears the memory state too.
A flag's value comes after = or after a space in fsl doctor and fsl upload-sourcemaps.fsl doctor --backend backend used to read the folder as true; --backend, --dist, --functions, --bucket, --prefix and --release now take the next word, and a value flag with no value exits 1 and shows the correct form. --json, --strict, --force, --global and --embed-sourcemaps stay switches and never take the next word.
A cut fsl logs scan no longer says "0 matched". When the scan stopped at its 5000-entry limit and no row matched, it printed "scanned: only the newest 5000 entries" and "0 entries matched", which reads as "nothing is there". It now prints one line that says the answer is not known, how many entries were read, and how to narrow.
fsl doctor no longer invents a ./functions folder. A firebase.json with hosting and no functions key, for an app whose backend runs on Cloud Run, reported could-not-check for ./functions and callable-without-firebase-functions for a folder nothing named. callable-without-firebase-functions now appears only when firebase.json has a functions key.
The duplicate-storage fix says what a yarn 1 user does. It names the lockfile edit that left one copy of @google-cloud/storage in a test project. The skill-out-of-date fix says to run install-skills from the project root with the same fsl that ran doctor, in place of npx fsl.
The allowOrigin comment says when a cookie works. It said to name your origins if the gate reads a cookie, which is not enough: createHttpLogHandler never sends Access-Control-Allow-Credentials, so a browser blocks a request that carries a cookie to another origin. A cookie gate works when the page and the handler are on the same origin; across origins, send a bearer token in a header. A test pins that the handler does not send that header.
The Express example answers the browser's preflight.CAPABILITIES.md and the createHttpLogHandler doc comment mounted the handler with app.post, so Express answered the OPTIONS request itself with no CORS headers and a page on another origin was blocked. They now use app.all, and a test drives a real Express app to check it.
The labels example compiles.CAPABILITIES.md wrote the labels type as an interface, which initLogger<...> and withLogging<...> reject with TS2344; it is now a type alias, and the file lists the interface mistake. Four client examples left out the releaseId or the logFunction that initLogger requires; each now passes both. A typecheck pins the type limit, and a test checks every client initLogger example.
fsl logs attachments with no bucket names both variables. The error named FIREBASE_STORAGE_BUCKET only; it also reads VITE_FIREBASE_STORAGE_BUCKET. The platform label's comment now lists the values the client writes.
fsl upload-sourcemaps --embed-sourcemaps without --backend is an error. It used to embed nothing and still delete every .map from dist/ (and, with a bucket, upload but skip the embed); it now exits 1 before touching dist/, and uploadSourceMaps() throws. The usage text also names where the release id comes from: --release, else VITE_RELEASE_ID, else RELEASE_ID.
The skill-out-of-date fix works as written. It said to run install-skills, which replaces no file that is there when nobody can answer, so the finding stayed. It now says fsl install-skills --force.
A leading ~ in the key file path is the home folder.GOOGLE_APPLICATION_CREDENTIALS=~/keys/app.json in .env.local was read as a folder named ~ under the project. ~/… and a bare ~ now mean the home folder; a ~ anywhere else is left as written.
An error on fsl logs schema or fsl logs attachments shows an example of that command. A wrong flag, or a flag with no value, showed a query example. It now shows fsl logs schema --refresh --project my-project or fsl logs attachments 01JAXYZ... --bucket my-bucket.
fsl doctor's Storage line names the library and no bucket. It printed firebase-admin, default bucket for an app that names a bucket in code, which doctor cannot read. It now prints firebase-admin.
CAPABILITIES.md names bc.action( in the handler of an element with data-fsl-action. The mark records a breadcrumb before the handler runs and the call records another, so one click leaves two, with the same name or not. The old line in Marked actions covered only the same name and advised keeping a call with data beside the mark, which still leaves two.
/fsl-review holds the Mistakes lines against code that already uses a capability. An app with bc.handledError( above logger.error( was called right because the client setup was present. The review now checks each Mistakes line of every capability the code uses before it calls that code right, counts "about ten places" for one capability over the whole scope, and runs doctor once when every install in the project has the same version.