You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@flagon.apache.org by "brucearctor (via GitHub)" <gi...@apache.org> on 2026/10/11 23:20:14 UTC

[PR] fix: resolve pre-release audit bugs, browser detection, extension filters, site CSP/links, and DOAP (flagon)

brucearctor opened a new pull request, #190:
URL: https://github.com/apache/flagon/pull/190

   ## Summary
   Resolves 12+ bugs uncovered during the pre-release codebase audit across `flagon-userale`, `flagon-userale-ext`, `flagon-distill`, `site/`, and `doap_flagon.rdf`, while closing remaining open enhancement and website issues ahead of the `v2.5.0` release vote:
   
   ### 1. `flagon-userale` Audit Fixes & Browser Metadata (#108)
   - **Public API Exports**: Exported `registerHeadersCallback`, `resetHeadersCallback`, `resetAuthCallback`, `registerExporter`, and `detectBrowser` from `src/main.ts` and exposed `registerHeadersCallback`, `registerExporter`, and `detectBrowser` on `window.userale`.
   - **Host `window.onload` & `pageLoadTime` Safeguard**: Replaced `self.onload = ...` (which overwrote host page `window.onload` handlers) with `self.addEventListener("load", ...)` and safeguarded `pageLoadTime` (`Math.max(1, (endLoadTimestamp ?? Date.now()) - startLoadTimestamp)`) so it is never `NaN` or `0` when UserALE initializes after `window.load`.
   - **Zero-Dependency Browser Metadata (#108)**: Implemented `detectBrowser()` using `navigator.userAgentData` Client Hints with a regex fallback on `navigator.userAgent`, populating `browser: { browser, version }` on raw, custom, and interval logs.
   - **SVG Element Selector Fix**: Fixed `getSelector(ele)` when `ele` is an `SVGElement` (where `ele.className` is an `SVGAnimatedString`) so it extracts `ele.getAttribute("class")` instead of producing `"svg.[object SVGAnimatedString]"`.
   - **`packageCustomLog` Detail Callback Fix**: Fixed `packageCustomLog` so `detailFcn()` is invoked even when `userale.details()` has no default handler for the custom event type.
   - **Headers Callback Validation**: Fixed `verifyHeadersCallback` to reject `null` and array return values (`typeof null === "object"`).
   - **Exporter Cache & `exporterFormat` Alias**: Added `registerExporter(exporter)` and `exporterFormat` (`'v2-json' | 'otlp-json' | 'proto-json'`), included `otlpEndpoint`, `exporterFormat`, and `websocketsEnabled` in `resolveExporter`'s cache key, and prevented duplicate `pagehide` listeners in `initSender`.
   - **Metadata**: Updated `package.json` `repository.url` to `https://github.com/apache/flagon.git` (keeping `"version": "2.4.0"` intact until the PMC release vote).
   
   ### 2. `flagon-userale-ext` Fixes & Configurable Filters (#107, #109)
   - **Configurable Event & Log Type Filters (#109)**: Added `filterEventTypes` and `filterLogTypes` options to the extension Options UI (`src/options/logging.tsx`), storage (`src/utils/storage.ts`), and background filter pipeline (`src/background/ports/log.ts`).
   - **MV3 Service Worker Race Condition Fix**: Initialized `allowListRegExp` at module load from `DEFAULT_OPTIONS.allowList` so logs arriving immediately on service worker wake-up do not throw `TypeError: Cannot read properties of undefined (reading 'test')`.
   - **Options Save Alert Fix**: Sent response payload in `src/background/messages/config_change.ts` (`res.send("Configuration saved!")`) so saving options no longer triggers `alert(undefined)`.
   - **Playwright MV3 Fixture Stability**: Awaited the extension background service worker in `extension.fixture.ts` before opening pages and configured `playwright.config.ts` with `open: "never"` so test runs do not hang on failure.
   
   ### 3. `flagon-distill` Audit Bug Fixes
   - **`Log.__init__` Schema Validation**: Fixed inverted `if issubclass(schema, BaseModel): raise TypeError(...)` check (changed to `if not issubclass(...)`) and fixed `Log.__ge__` (`>=` instead of `>`).
   - **`Segment.__init__` Mutable Default**: Replaced `uids=[]` mutable default argument with `uids=None`.
   - **`funnel(..., infer=False)` Crash**: Wrapped `nx.utils.pairwise(targets)` in `list(...)` before subscripting `[0]`.
   
   ### 4. Website CSP & Stale Links (#111, #122) & DOAP (#97)
   - Removed external Google Fonts `@import url(https://fonts.googleapis.com/...)` from `site/semantic/dist/` CSS files and switched the demo map tile layer to `https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png` to comply with the ASF Content Security Policy (#111).
   - Updated stale `flagon-useralejs`, `flagon-distill`, and `github.com/apache?q=flagon` links across `site/` to point to the `apache/flagon` monorepo over HTTPS (#122).
   - Expanded `doap_flagon.rdf` with fuller project descriptions and `<release>` blocks for UserALE.js `2.4.0` and Distill `0.1.0` (#97).
   
   Closes #97
   Closes #107
   Closes #108
   Closes #109
   Closes #111
   Closes #122
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@flagon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@flagon.apache.org
For additional commands, e-mail: pr-help@flagon.apache.org


Re: [PR] fix: resolve pre-release audit bugs, browser detection, extension filters, site CSP/links, and DOAP (flagon)

Posted by "brucearctor (via GitHub)" <gi...@apache.org>.
brucearctor merged PR #190:
URL: https://github.com/apache/flagon/pull/190


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@flagon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@flagon.apache.org
For additional commands, e-mail: pr-help@flagon.apache.org