← Back to list4/9/2026, 4:43:09 PM
01Issue
FeatureOpenSwamp Club
AssigneesNone
Bug: authenticated pulls always shows 0 on profile page
Opened by stack72 · 4/9/2026· GitHub #213
Description
Authenticated pulls count is always 0 on the profile page, even when logged-in users have pulled extensions.
Data flow
- Download route (
routes/api/v1/extensions/[...path].ts:163-196) — firesextension_pulledtelemetry event withpuller_user_idfromctx.state.user - Telemetry consumer (
services/telemetry/lib/consumers/extensions.ts:51-62) — writes pull record toextension_pullscollection withpulledByUserId - Pull stats query (
lib/infrastructure/mongo-extension-pull-repository.ts:45-82) — aggregates pulls, counts authenticated vs anonymous based onpulledByUserId != null - Profile page (
routes/u/[username].tsx) — callsrepo.getAuthorStats(username)and displaysauthenticatedPulls
Likely cause
Extension pulls happen via CLI tools (e.g. swamp pull extension-name), which likely don't send session cookies with the download request. Even if the user is logged into swamp.club in their browser, the CLI's HTTP request to /api/v1/extensions/{name}/{version}/download won't carry the browser session, so ctx.state.user is always null for pull requests → puller_user_id is always null → every pull is recorded as anonymous.
Possible fixes
- CLI auth: Have the CLI authenticate with an API token/key so pull requests carry user identity
- Query-param token: Pass a short-lived download token that identifies the user
- Accept that CLI pulls are anonymous and reconsider whether "authenticated pulls" is a meaningful metric to display, or remove it from the profile stats
02Bog Flow
Open
No activity in this phase yet.
03Sludge Pulse
Sign in to post a ripple.