crbench//

← leaderboard

cursor vs Mjolnir (Opus 5.5)

cursor → Mjolnir (Opus 5.5) →

On 127 cases both reviewed: cursor caught 163, Mjolnir (Opus 5.5) caught 167. Defects below are weighted by severity (critical first); each links to its case.

Only cursor caught — 21

critical  feat: 2fa backup codes  security
The diff replaces the TOTP branch with `if (user.twoFactorEnabled && credentials.backupCode)`, which takes priority over TOTP verification, while the unchanged password gate above it verifies the password only when `totpCode` is falsy (`if (user.password && !credentials.totpCode)`). Posting an email, any non-empty `totpCode`, and a stolen backup code therefore skips the password check and authenticates on the backup code alone, without the password and without ever reaching TOTP verification.
maybeDoSizeFlush assigns `lastFile.Span.EndKey = newSpan.Key` without cloning, but newSpan.Key aliases the caller's reused scratch buffer in compactSpanEntry. The next WriteKey overwrites scratch in place, silently mutating the already-recorded EndKey and producing BackupManifest_File entries with overlapping/drifted spans (corrupted backup metadata). Sibling Reset paths in the same file clone correctly; maybeDoSizeFlush was missed.
scheduleSMS returns undefined on SMS-lock and throws on rate-limit/missing-creds; both paths increment retryCount, and the new deleteMany OR clause (retryCount > 1, with no method/date filter) permanently deletes those reminders after a few cron runs, so transient locks, monthly rate-limits, or a temporary Twilio misconfiguration silently drop reminders that previously stayed scheduled=false and were retried until scheduledDate.
TopicRetriever fetches the embed/feed URL with `open(url).read` (Readability) and `open(SiteSetting.feed_polling_url)`. The only guard is `invalid_host?`, which pins the initial referer/embeddable_host; open-uri transparently follows HTTP redirects, so a whitelisted host returning a 3xx to an internal address (link-local 169.254.169.254, a private IP, or a localhost admin port) reaches it. This is a redirect-based SSRF that the host whitelist does not cover.
A race condition in BuildIndex allows multiple goroutines to concurrently build the same expensive index for the same key. This is caused by moving the b.cacheMu lock from protecting the entire function to only protecting the final cache assignment.
Passing `nextConfig: __NEXT_HAS_REWRITES ? undefined : nextConfig` to getNextPathnameInfo was meant to preserve the locale prefix, but disabling the whole config also disables basePath stripping. The `/_next/data/<buildId>/...` prefix is never removed, and on a catch-all route the route regex overwrites router.query.<param> with the leftover data-URL segments, producing malformed URLs and 404s when basePath + rewrites + middleware + dynamic routes combine.
medium  feat: 2fa backup codes  security
Backup code validation is case-sensitive due to the use of indexOf(). This causes validation to fail if a user enters uppercase hex characters, as backup codes should be case-insensitive for a better user experience.
The diff converts the outer cancellation lookup from `find` to `filter` and loops over every calendar reference, but the recurring branch still resolves a single reference with `references.find((ref) => ref.type.includes('_calendar'))` and iterates only the organizer's credentials. For each remaining occurrence only the first reference is deleted and only with the organizer's credentials, so team members' calendar events survive the cancellation.
`sendAddGuestsEmails` takes no event-type metadata and unconditionally sends to the organizer, every team member and every attendee, while every other booking-lifecycle sender in the same file gates on the helpers that read `disableStandardEmails.all.host` and `.attendee`. The handler already loads the event type, so the metadata is in hand and simply not passed, and an organizer who disabled standard emails still has them sent.
Asynchronous functions deleteScheduledEmailReminder and deleteScheduledSMSReminder are called without await inside forEach loops. This occurs during booking rescheduling/cancellation, and workflow/workflow step deletion/updates. Consequently, scheduled workflow reminders may not be reliably cancelled, potentially leaving them active.
The new image-set loader offers a "Pad" resize option whose branch is identical to "Stretch": it calls the same full resize to the target width and height, with no aspect-preserving thumbnail and no border fill. A user who loads a folder of differently sized images and picks "Pad" to keep aspect ratio gets every image whose size differs from the first one non-uniformly squashed, silently corrupting the training data, with nothing reporting that the chosen option behaved the same as "Stretch".
Race condition: Multiple concurrent requests could pass the device count check simultaneously and create devices beyond the limit. Consider using a database transaction or lock.
`TestNewClaimInfoFromClaim` and `TestNewClaimInfoFromState` assert with an inverted condition: `if reflect.DeepEqual(result, test.expectedResult) { t.Errorf(...) }`. That reports a failure only when the result MATCHES the expectation, so the tests never validate the constructor and pass vacuously (and `expectedResult` is left nil). The fix inverts the check to `if !reflect.DeepEqual(...)`.
The textarea XML schema is changed to declare the placeholder property as `placeholder_text`, but the textarea XML parser, which the change does not touch, still matches only the attribute name `placeholder`. XML written against the updated schema, such as `<lv_textarea placeholder_text="Type here"/>`, matches no branch in the parser's attribute chain, so `lv_textarea_set_placeholder_text` is never called. The attribute loop has no unknown-attribute warning, so the placeholder is dropped silently.
In imageOptimizer's internal-request path, `if (!mockRes.statusCode)` can never be true for any real HTTP status code (`mockRes.statusCode` starts at 200 and is only ever set to other truthy numbers like 404/500 by `handleRequest`), so the intended check for a failed internal response never fires. The old code additionally forwarded the upstream status via `res.statusCode = mockRes.statusCode`; this diff removes that forwarding entirely, so an internal 404/500 is masked behind an eventual 200 (until a secondary content-type check happens to catch it).
OAuth state uses pipeline.signature (static) instead of a per-request random value
The upsampling eligibility check passes the outer dataset instead of the actual dataset used by scoped_dataset. In paths where the query ultimately runs against discover (e.g., dashboard split) while the original dataset is metrics, upsampling may be skipped even when all projects are allowlisted.
low  feat: 2fa backup codes  security
Because backupCodes are decrypted and mutated in memory before being written back, two concurrent login requests using the same backupCode could both pass this check and update, so a single backup code may effectively be accepted more than once if used concurrently, weakening the intended one-time-use semantics.
record_for_host compares lower(host) = ? but does not normalize the parameter’s case, so mixed‑case referer hosts may fail to match even though comparison intends to be case‑insensitive.
The GetWebAssets function implements an incomplete double-checked locking pattern for caching web assets. The function first checks if the cache is populated using a read lock (RLock), and if the cache is empty, it acquires a write lock to populate it. However, it fails to re-check whether the cache was populated by another goroutine while waiting to acquire the write lock.
The app-route template's outer catch now calls `routeModule.onRequestError(req, err, {...})` without the fourth `routerServerContext` argument that every other call site in this diff passes. `RouteModule.onRequestError` therefore falls back to a bare `console.error(err)` instead of `routerServerContext.logErrorWithOriginalStack`, so a server started with `quiet: true` now prints route-handler errors, a normal server loses the standard error prefix, and in dev the original-stack logger is skipped.

Only Mjolnir (Opus 5.5) caught — 25

The diff changes what Handler.transform's return value means (handler.ts): it used to be "adjust the default row in place, or return a replacement", with run() posting `this.transform(event, row) ?? row`, and now returning nothing drops the event, with run() doing `if (!row) { result.skipped += 1; continue; }`. It adds `return row` to every handler whose transform adjusted the row in place and returned nothing, and makes charge.succeeded and invoice.paid drop zero amounts. It leaves alone the transforms that already end with a return: the family bases, the 21 payout and fee handlers that end `return withMemo(row, ...)` (annotations.ts), which sets the memo and returns the row, and DisputeCreatedHandler (dispute-created.handler.ts), whose transform calls `super.transform(event, row)` and ends `return noteMissing(event, "reason")`. noteMissing() logs the optional fields the event lacks and returns nothing (`: void`), which TypeScript accepts as a return from a transform typed `LedgerRow | void`. That was harmless while run() fell back to the adjusted row; now run() reads the undefined as "drop", and every charge.dispute.created event is counted as skipped: the amount the provider holds back never reaches the ledger, and the held-funds account and the reconciliation against the provider balance are silently off by every open dispute, with nothing rejected. The other handlers that call noteMissing() call it as a statement and now return the row after it. The HeldFunds mixin's @audited transform returns the hook's result for held funds and other rows alike. The handlers are reached only through registry.ts, which the diff doesn't touch.
The new line `if (response.statusText !== "OK")` in salesforce CalendarService.getClient checks statusText, but Node's global fetch (undici) returns an empty statusText for HTTP/2 responses served by login.salesforce.com, so a successful 200 yields `"" !== "OK"` and throws HttpError on every Salesforce client construction.
The new migration inserts each newline-split token of the old `embeddable_hosts` site-setting value directly into a raw SQL string: `execute "INSERT INTO embeddable_hosts (host, category_id, created_at, updated_at) VALUES ('#{h}', #{category_id}, ...)"`. `h` is unsanitized admin-controlled free text (the setting had no hostname validation); a value containing a single quote (an accidental typo or a deliberate payload) produces malformed SQL or executes arbitrary statements. Migrations run with DDL-capable database credentials, so the blast radius is large.
The enableSqlExpressions function has flawed logic that always returns false, effectively disabling SQL expressions unconditionally:
The informer transform `trim` calls `accessor.SetManagedFields(nil)` unconditionally on every resync, mutating the object that lives in the shared informer cache. Because that cached object is read concurrently by other informer consumers, the unconditional in-place mutation is a data race that can panic kube-controller-manager / scheduler. The fix guards it (`if accessor.GetManagedFields() != nil`) so the transform is idempotent and does not rewrite shared state when already trimmed.
Continue requests are served from a cache snapshot without a freshness wait, so a lagging cache returns a stale, incomplete page. A continue request carries no explicit ResourceVersion (forbidden), so `Cacher.GetList` computes `listRV = 0` and `WaitUntilFreshAndList` does not block; the serve path then calls `listExactRV(key, continueKey, continueRV)` -> `snapshots.GetLessOrEqual(continueRV)`, which returns the greatest snapshot <= continueRV even when the cache has not reached continueRV, and labels the response `ResourceVersion = continueRV`. In an HA cluster a continue token minted by a fresh apiserver A and routed to an apiserver B whose watch cache lags continueRV yields an older snapshot's page mislabeled at continueRV, silently dropping objects created in (snapshotRV, continueRV].
The new pod index `AddPodControllerUIDIndexer` / `PodControllerUIDIndex` keys solely on the owning controllerRef's UID (`[]string{string(ref.UID)}`), ignoring namespace, kind, and name. Controllers (DaemonSet/ReplicaSet/Job/StatefulSet) that look pods up through this index can claim the wrong pods when a stale or duplicated ownerReference UID collides. The fix re-keys the index on the full (namespace, kind, name, uid) tuple.
high  feat(sig): custom agents  cross-file
In the new signals auto-start path (_resolve_autostart_assignee in products/signals/backend/auto_start.py), candidate users are filtered with User.objects.filter(..., teams__id=team_id). User.teams is a @cached_property on the User model, not an ORM relation, so this lookup raises Django FieldError ("Cannot resolve keyword 'teams' into field") every time the path reaches the query. The exception is swallowed upstream, so report generation keeps working but the auto-start path silently creates zero implementation tasks. It is cross-file because the teams cached_property lives in the user model file while the broken filter is in the changed auto_start.py code.
MetricAlertDetectorHandler inherits from StatefulDetectorHandler but only contains pass, failing to implement its required abstract methods: counter_names (property), get_dedupe_value(), get_group_key_values(), and build_occurrence_and_event_data(). This will cause a TypeError at runtime when the class is instantiated.
The diff adds `await prisma.workflowReminder.update(...)` inside the loop's catch block, which previously held only a `console.log` and so could not fail. Nothing wraps the loop: the handler's only try/catch is the inner one, and the `for` at line 55 closes with no surrounding handler, so a throw from that update escapes the loop and the handler, and `res.status(200).json(...)` is never reached. One reminder's DB failure now aborts the whole batch, where before each iteration was isolated. Reachable: Prisma's update raises P2025 when the row is gone, which this diff makes likelier by adding a deleteMany branch that can remove rows a concurrent cron run is processing. Independent of d2 and d3 -- d2 is the missing `method: SMS` filter on deleteMany, d3 is the locked-account misclassification, and fixing either leaves this failure path in place. Medium rather than high: the unreached reminders keep `scheduled: false` and fall inside the query's `scheduledDate <= now + 7 days` window, so the next cron run picks them up. The loss is fault isolation and a deferred batch, not dropped reminders, and it only reaches a user when a send time falls inside the gap before the next run.
recordTransaction unconditionally records CommitLat via getCommitLatency() for both txnCommit and txnRollback, but sessionStartTransactionCommit/sessionEndTransactionCommit are only set in commitSQLTransaction and never reset between txns, so rolled-back transactions record a stale (prior commit) or zero commit latency into their CommitLat stats.
Passing 80% as the dimensions can fail for animated GIFs when allow_animated_thumbnails is true, since the animated path uses gifsicle --resize-fit which expects WxH geometry, not a percentage; downsizing would then silently fail.
`ZUploadPrivateFileRequest` gains `elementId` as a required string with no `.optional()` and no default, and its single consumer returns 400 on parse failure before destructuring the field into the signed-URL path. The published contract is not updated: the OpenAPI reference still documents the endpoint as requiring only surveyId, fileName and fileType, and the diff does not touch it.
`isScopedPrivateUploadUrl` rejects anything that is not exactly the new eight-segment shape (`if (segments?.length !== 8) return false`), and `validateClientFileUploads` fails on that. Legacy private upload URLs are four segments, so a response created before the deploy can never be updated afterwards. The same diff's `parseStorageFileUrl` is deliberately tolerant, so the delete path stays backward compatible while the validate path does not.
The diff removes the fail-fast `IllegalStateException` that rejected multiple crypto providers on the classpath, replacing it with an order-based sort, a debug log and `foundProviders.get(0)`. All three real providers return the same order value, and `Stream.sorted` is stable, so a tie is resolved by ServiceLoader enumeration order: on a deployment carrying both the default and the FIPS provider, which one is selected depends on classpath ordering rather than configuration.
In verifySafeHtml the prefix length `start` and suffix length `end` are computed independently with no `start+end <= value.length()` guard, so when the OWASP sanitizer balances mis-nested allowed tags (e.g. `<p><b>x</p>` → `<p><b>x</b></p>`) the overlapping prefix/suffix make `value.substring(start, value.length()-end)` have beginIndex > endIndex, throwing StringIndexOutOfBoundsException exactly on the illegal-HTML case it should report.
The client-credentials grant builds its token through `tokenManager.responseBuilder(...).generateAccessToken()` directly, bypassing the shared response path where the diff sets `Constants.GRANT_TYPE` on the client session context. `initToken` then reads that attribute, finds it null and substitutes the unknown marker, so every client-credentials token id encodes `na` rather than the shortcut the diff registers for this grant. Every other direct-responseBuilder path in the PR was updated; this one was missed.
ConditionalPasskeysEnabled() called without UserModel parameter
The new source-action code generators emit commands with a hardcoded `nbls.`-prefixed name (e.g. `new Command(..., "nbls.generate.code", ...)`) instead of routing the name through `Utils.encodeCommand(command, client.getNbCodeCapabilities())` the way the sibling generators do. Any LSP client whose capabilities use a different command prefix gets a dead source-action menu. The fix runs the command name through `encodeCommand` so it respects the client's prefix.
The new `upsampled_count` SnQL function in `DiscoverDatasetConfig` (datasets/discover.py) is `toInt64(sum(sample_weight))` with no fallback for a missing weight. Snuba stores `sample_weight` as Nullable(Float64) and writes NULL for any error event that carried no client sample rate, and `sum` skips NULLs. Once events-stats rewrites `count()` to `upsampled_count() as count` for an allowlisted project set, every unweighted event counts as 0 instead of 1, so error charts undercount, and a bucket holding only unweighted events returns NULL instead of its event count.
rewriteExpression replaces all quoted string literals in the HAVING expression with __QUOTED_N__ placeholders BEFORE matching column-map keys against it. A key like countIf(level='error') (itself containing a quoted literal) is turned into a regex built from its raw, unprotected form, so it can never match the already-placeholder-substituted expression -- e.g. a HAVING clause countIf(level='error') > 10 reads as countIf(level=__QUOTED_0__) > 10 after quote-protection, and the \bcountIf\(level='error'\) pattern silently fails to match, so the rewrite (and the __result_N substitution downstream code depends on) is silently skipped.
getProjectStats calls .collect() on all tasks for a project, loading every matching document into memory; for projects with many tasks this can exceed Convex's read/memory limits and crash the query.
`checklist` is stored as a growing `v.array(...)` on the task document, so its size is bounded by Convex's 1 MB per-document limit rather than by anything in the code: once a task accumulates enough items the patch in `addItem` fails and the task can no longer be written. Every toggle also rewrites the whole array, so write cost grows with the item count, and individual items cannot be indexed or queried. The fix is a separate `checklistItems` table keyed by `taskId`. Stated as the document-size limit rather than as a design preference, because that is the hard ceiling that makes writes fail and is what expectations.md records as the pass condition ("risks hitting the 1MB document size limit").
uniqueGuests filters out existing attendees and blacklisted emails but does not deduplicate duplicates within the input; createMany can insert duplicate attendee rows if the client submits repeated emails.
logic: macOS-specific sed syntax with empty string after -i flag will fail on Linux systems

Both missed — 48

In listWithTeamHandler (packages/trpc/server/routers/viewer/eventTypes/listWithTeam.handler.ts), this PR adds `AND "public"."EventType"."teamId" IS NULL` to the WHERE clause of Part 1 of the raw SQL UNION query. Part 1 previously returned every EventType owned by the current user (`userId = currentUser`); the new condition restricts it to non-team event types only. Team event types are then expected to come from Part 2, which discovers them via an INNER JOIN on Membership. But a team event type whose `userId` is set to the current user while that user has no Membership row for the team falls through both branches: Part 1 excludes it (teamId is not null) and Part 2 excludes it (no Membership). The result is that such owned team event types silently disappear from the listing, breaking the event-types view for owners-without-membership.
In useBookings, this PR renames the instant-booking query parameter from bookingId (a number) to bookingUid (a string), but the getInstantBookingLocation query is still gated only on `enabled: !!bookingUid` with no isInstantMeeting guard. A non-instant "additional seats" booking flow carries a bookingUid in the URL (Booker store setSeatedEventData), so the query now fires for it; when the existing booking's metadata has a videoCallUrl, RedirectToInstantMeetingModal pushes the booker to that video page, and otherwise an error toast shows. Either way the seat cannot be booked. Before the rename the value was read as `parseInt(getQueryParam("bookingId") ?? "0")`, which was 0 (falsy, query disabled) on those URLs, so the rename is what newly triggers the path. The fix gates both the query and the redirect effect on isInstantMeeting.
The new eventDecoder builds each event's row from `getPhysicalColumnsSchema`, which drops every computed column, stored ones included. When the crud writer applies a replicated delete for a row the destination does not have, the table handler passes that row to `tombstoneUpdater.updateTombstone`. The tombstone updater's row.Deleter is built from `writeableColunms`, which keeps stored computed columns, and indexes the row by position. On a table with a stored computed column, every later column's datum is shifted. For example, on `(k INT PRIMARY KEY, c INT AS (k+1) STORED, v INT, INDEX (v))` the Deleter reads `v` at ordinal 2 of a 2-element row, and secondary-index encoding panics with index out of range. A stored computed column ahead of a primary-key column shifts the primary-key datum in the same way.
This PR renames the private storage download/delete route from a single-segment [fileName] dynamic parameter to a catch-all [...filePath], specifically so it can also serve the newly introduced /storage/{workspaceId}/private/surveys/{surveyId}/elements/{elementId}/{file} scoped upload paths (per the PR's own description: "Scope new private upload URLs under .../surveys/{surveyId}/elements/{elementId}/..."). Both the nested route shape and the underlying storage key scheme for element-scoped uploads are new in this diff. Routing these newly introduced, more sensitive per-response upload files through the SAME entry point -- still gated only by the pre-existing, role-blind hasUserWorkspaceAccess (see d1) -- exposes them to billing-role users for the first time. This is a diff-attributable widening of exposure, distinct from d1's own (pre-existing, unchanged) check logic: unlike d1, this defect is genuinely introduced by the diff and should not be excluded from headline scoring.
This change deletes the `github.com/scottlepp/go-duck/duck` dependency and points every SQL expression call at a new local `sql.DB` whose three methods each return `errors.New("not implemented")`. `parser.go` swaps `duck.NewInMemoryDB()` for `NewInMemoryDB()` and `sql_command.go` does the same in `Execute`, so `sql.TablesList` now always fails and `NewSQLCommand` returns `BadRequest("sql-invalid-sql")` for any non-empty query. The unchanged legacy path in `pkg/expr/nodes.go` reaches it with no gate: its `case TypeSQL:` calls `UnmarshalSQLCommand(rn)` and, unlike the `TypeThreshold` branch directly above, takes no `toggles` argument. Any saved TypeSQL expression evaluated without FlagExpressionParser therefore fails to build on every evaluation, where it previously ran. Independent of d1: d1 is the flag function returning false in both branches, and fixing it leaves this failure in place, because `NewSQLCommand` dies in `TablesList` before `Execute` is ever reached.
In `prepareResources`, the branch that handles an already-prepared claim (`if claimInfo.isPrepared()`) does `return nil` instead of `continue`. Because this runs inside the `for ... range pod.Spec.ResourceClaims` loop, the first already-prepared claim short-circuits the whole loop and the pod's remaining ResourceClaims are never prepared. The fix changes `return nil` back to `continue`.
The response-handling refactor builds the /_next/data JSON page response as Buffer.from(JSON.stringify(result.value.pageData)). RenderResult.isDynamic decides static-vs-dynamic via `typeof this.response !== 'string'`, so a Buffer is misclassified as a dynamic stream; sendRenderResult then skips Content-Length and ETag and falls back to Transfer-Encoding: chunked, breaking CDN-side compression for self-hosted Pages Router deploys. The fix deletes the Buffer.from wrapper. (Large-diff stress case: ~3k lines, 22 files.)
With `trailingSlash: true`, the new handler templates (app-page.ts, app-route.ts, pages.ts) take `resolvedPathname` from the request URL, which base-server now rebuilds from the raw `initURL` and which still ends in a slash. None of them calls `removeTrailingSlash`, which base-server applied before its cache-key and prerender lookups. The build writes prerender-manifest keys without the slash, so every lookup misses. For app-page, a prerendered page on a `dynamicParams = false` route is taken to be unlisted and throws NoFallbackError (404), and the ISR cache key becomes `/blog/a/`, so the prebuilt output is never served.
The re-implemented Server Action reducer now rejects the action's promise with a redirect error for every redirect, external ones included, where it previously resolved them, and builds that error's URL with createHrefFromUrl, which keeps only the path and query, so an external URL loses its origin. Called from a form action or useTransition, React catches the handled error and the external navigation that handleExternalUrl staged (mpaNavigation) goes through. Called outside a React scope, such as a plain onClick, the rejection reaches the app router's unhandledrejection handler, which pushes the same-origin path; that navigation supersedes the external one, so the redirect to the external URL never happens.
The PR added API-key environment scoping to only the create and update integration routes. The sibling mutations removeIntegration, setIntegrationAsPrimary, and autoConfigureIntegration on the same controller were left unscoped, so an API key from one environment can delete, re-prioritize, or auto-configure integrations in another environment of the same org (cross-environment IDOR).
The change narrows shouldShowSyncColumns with `&& selectedConnector.supportsColumnSelection`, correct for column-selection but the same flag also gates the Sync-method, Sync-field, and Primary-key columns. supportsColumnSelection is false for all non-SQL sources (Stripe, Hubspot, REST), so those three controls silently disappeared for every non-SQL source during table setup.
A new usage-report query runs raw `FROM logs` through sync_execute() on the logs cluster. HogQL resolves its `logs` table to the physical `logs_distributed` table, and production's logs cluster has no table named `logs`: the `logs` Distributed table that migration 0214 creates exists only in local and test schemas, which is why the PR's test passes. In production the query fails, and since the new query runs unconditionally it aborts the whole usage-report run that feeds billing (reverted the next day in #60611).
In pkg/querier/postprocess.go the new prepareFillZeroArgsWithStep builds the fillZero function args as {req.Start, req.End, step} where step is computed in milliseconds (query.StepInterval.Duration.Milliseconds()) but req.Start/req.End are not guaranteed to be in milliseconds at runtime (callers may pass nanosecond-resolution timestamps). funcFillZero requires all three args in the same unit and loops from start to end by step appending one point per iteration; when start/end are nanoseconds and step is milliseconds the iteration count is ~10^6x too large, so the fill-zero path allocates an enormous slice of zero points and blows up memory / OOMs the query service.
valid_entries() uses a bare truthiness check (`if e`) but its docstring promises "the non-empty entries." This silently drops legitimate falsy-but-non-empty values too -- 0, 0.0, False, [], {} -- not just "" or None. Any caller passing counts, scores, or booleans loses valid entries with no error raised.
commit() gates the staged navigation on truthiness (`if (state.pendingMpaNavigation)`), so an empty-string url is indistinguishable from the `null` initial state and the redirect is silently skipped. Before the diff the reducer called navigate(action.url) directly with no gate, so navigate("") ran. `Action.url` is typed `string` with no non-empty constraint, so dispatch({ type: "redirect", url: "" }) type-checks at the public boundary. Same falsy-vs-absent collision as t1-py-filter-shifts-pairing d2, introduced here by the new staging step.
The new immediateDelete branch of deleteScheduledEmailReminder cancels the scheduled email at SendGrid on the spot, and three new call sites use it (rescheduling in handleNewBooking, workflow and workflow-step deletion in workflows.tsx). Each such cancellation stays pending in SendGrid's scheduled_sends until the email's send time, up to 72h ahead, and SendGrid allows only 100 pending cancellations: the limit this PR's deferred, cron-driven cancellation exists to stay under. Under steady rescheduling the immediate cancellations fill it, after which cancellations are rejected (and only logged), both the immediate ones and the cron's deferred ones, so reminders for rescheduled and cancelled bookings are sent anyway.
Statement IDs are built with `h := fnv.New128()`; the stdlib hash/fnv constructor heap-allocates a hash object on every statement, and the ID is constructed even when not required. On hot SQL paths this is a measurable allocation/throughput regression (the fix's microbenchmarks show kv95 +3.42%). The fix uses a lightweight value-type FNV and only builds the ID when needed. (Large-diff stress case: ~2.8k lines, 14 files.)
The new downsize loop tests `tempfile.size` and passes the same expression as the filesize argument to `Upload.create_for`, but the conversion ends in an image optimizer that atomically replaces the file. After the first pass the open Tempfile descriptor refers to an orphaned inode, so the reported size stops tracking the file on disk: the loop condition is frozen at the post-first-pass value and the upload is then rejected as too large by the validator even though the file has been shrunk well under the limit.
NoMethodError before_validation in EmbeddableHost
The new plural-ID hydration branch in `_hydrateEmbedded` (added alongside the existing singular path) maps a list of ids through `_lookupSubType` and assigns the result unconditionally: `obj[self.pluralize(subType)] = hydrated || []`. `_lookupSubType` returns `undefined` for an id whose root collection or specific id isn't found; since Array.prototype.map always returns an array, `hydrated` is always truthy and the `|| []` fallback never fires, so the resulting array can contain literal `undefined` entries (e.g. [ModelObj, undefined, ModelObj]). This is the reverse of the existing singular path, which correctly guards with `if (hydrated)` before assigning.
`remove_member` deletes the association with `group.users.delete(user_id)`, which for a has_many-through with no `:dependent` resolves to a raw `delete_all` and never instantiates the join model, so the `counter_cache` on GroupUser never decrements. The sibling add path uses `group.add(user)`, which does instantiate and increments, so `groups.user_count` drifts upward monotonically and is rendered to admins and returned by the group endpoint.
The claimInfo-cache tests seed their "item in cache" fixtures under the key `claimName + namespace`, but the cache itself keys entries on `namespace + "/" + claimName`. The mismatched key means the seeded entry is never found, so the `get`/`delete`/`contains` tests pass vacuously without exercising the real lookup. The fix keys the fixtures on `namespace + "/" + claimName` to match the cache.
Both group list endpoints drop the hoisted global permission check (`boolean canViewGlobal = groupsEvaluator.canView()`) and filter with a per-group `groupsEvaluator::canView`. Under fine-grained admin permissions v2 that per-group call falls through to a resource lookup and a full uncached policy evaluation, so one evaluation becomes one per group; the subgroup endpoint is worse because it fetches subgroups unbounded and paginates only after filtering.
The new tabview tab-button create callback reads the optional `index` attribute and passes the result straight to the XML integer parser. A missing attribute makes the lookup return NULL and the parser dereferences it immediately, so any XML using the tab-button element without an explicit index crashes once the tabview already has a tab, instead of falling back to the first tab.
The filename language guesser reuses one `checked_tag` latch for both the hearing-impaired (`sdh`/`hi`/`cc`) and the newly added `forced` suffix, so only the last dot-separated suffix is ever tested as a tag. For a subtitle named `movie.en.sdh.forced.srt` the parser strips `forced`, sets the latch, and then reads `sdh` as the language, returning language "sdh" with the hearing-impaired flag unset. With the suffixes the other way round, `movie.en.forced.sdh.srt`, the six-letter `forced` fails the primary-subtag length check, so no language is found and the forced flag is lost. The wrong language reaches real tracks through subtitle autoload and sub-reload.
`SourceUtils.findMatchingChild` iterates a folder's children and returns the first name match without excluding directories (no `isFolder()` / file-vs-folder check). A directory whose name equals the class name (e.g. a package dir `Test/` next to `Test.java`) is returned as the "source file", so go-to-source resolves to a folder instead of the file. The fix skips folders when matching.
The image-optimizer move to response-cache dropped the maxAge argument to sendResponse and hardcoded the cached-image header to `public, max-age=0, must-revalidate` instead of `max-age=${maxAge}`. The computed upstream/minimumCacheTTL maxAge is no longer propagated, so every optimized image returns max-age=0 and CDNs/browsers in front of a single instance stop caching, inflating origin load. (Large-diff stress case: ~3.6k lines, 15 files.)
`unstable_revalidate`'s new try/catch around the revalidation fetch discards the real error entirely: both a network failure and a non-OK HTTP response from the revalidation endpoint are collapsed into an identical, opaque `Failed to revalidate ${urlPath}` error with no status code, so callers can no longer distinguish a network outage from a 404/500 returned by the endpoint being revalidated.
The pages template sets `isIsrFallback` for an ungenerated path of a `fallback: true` route and clears it only for bots, minimal mode or an existing cache entry, never for on-demand revalidation. Base-server forced a blocking render when `isOnDemandRevalidate` was set. So `res.revalidate('/posts/new')` for a path not yet generated now returns the build-time fallback shell with its cache control deleted: nothing is stored, yet the response carries `x-nextjs-cache: REVALIDATED`, so the revalidate call reports success without generating the page.
The app-page template adds an early `if (isSSG && prerenderInfo?.fallback === false && !isPrerendered) throw new NoFallbackError()` that runs before draft mode or minimal mode is considered. The base-server check it replaces skipped preview/draft mode and minimal mode, and the sibling pages and app-route templates keep a `!isDraftMode` guard. A draft-mode request for a path of a `dynamicParams = false` app page that was not prerendered now returns 404 instead of rendering on demand, which breaks CMS preview of unpublished pages.
In applyFormulas (pkg/querier/postprocess.go), the new RequestTypeScalar branch calls applySeriesLimit on the result of processScalarFormula, but that result's Value is a *qbtypes.ScalarData while applySeriesLimit type-asserts result.Value.(*qbtypes.TimeSeriesData) and returns the result unchanged when the assertion fails. So for scalar/formula query results the call is effectively dead code: the configured order-by and limit on the formula are silently ignored, and scalar formula results come back unordered with no limit applied.
In VisitComparison's IN-clause branch, `case []any: values = varValues` passes an empty slice straight through when a variable resolves to []any{}. condition_builder.go's FilterOperatorIn handler then builds conditions := []string{} from an empty values, and sb.Or(conditions...) with zero arguments returns an empty string (confirmed in the vendored huandu/go-sqlbuilder@v1.35.0 source: Or returns "" when len(orExpr) == 0 after filtering). The generated WHERE-clause fragment for that condition vanishes rather than encoding "no rows match", so a filter meant to exclude everything silently matches all rows instead.
chSQLQuery.renderVars substitutes variable values into the raw ClickHouse query string via strings.Replace BEFORE parsing that string as a Go text/template (tmpl.Parse(query) / tmpl.Execute). If a variable's own VALUE contains the Go template delimiters {{/}}, the substituted text is then re-interpreted as a live template action in the second stage -- e.g. a variable value of "{{.SIGNOZ_START_TIME}}" gets replaced with the numeric start timestamp rather than being treated as literal text, silently changing the rendered query; a malformed template fragment (e.g. "{{.") causes template.Parse to fail, surfacing as an opaque HTTP 500.
parseFieldKeyRequest renames the field-key search parameter from ?name to ?searchText (r.URL.Query().Get("name") -> r.URL.Query().Get("searchText")). parseFieldValueRequest calls parseFieldKeyRequest internally (now reading ?searchText) and separately reads ?name for a different purpose (keySelector.Name, overriding what the key-request set). Any existing caller using GET /api/v1/fields?name=service_name to filter the field-key list gets back all keys instead of a filtered set -- the ?name parameter is simply ignored for that endpoint, a breaking API change with no version bump.
`toggleItem` declares `index: v.number()`, which accepts any float and NaN, and guards with `if (args.index < 0 || args.index >= checklist.length)`. Both comparisons are false for NaN, and 0.5 sits inside the range, so the guard passes, `checklist[args.index]` is `undefined`, and reading `.completed` off it throws an unhandled TypeError. Reachable from the public mutation API, which is what the validator exists to constrain.
The update and destroy methods in Admin::EmbeddableHostsController do not validate the existence of the EmbeddableHost record retrieved by ID. If EmbeddableHost.where(id: params[:id]).first returns nil (i.e., the host does not exist), attempting to call methods on the nil object (e.g., save_host or destroy) will result in a NoMethodError.
The new `EmbeddableHost` model's format validation explicitly accepts a port (`(:[0-9]{1,5})?`), and `before_validation` strips only the scheme and path, so a host entered as `http://example.com:3000` or `example.com:3000` is stored as `example.com:3000`. `record_for_host` compares the port-less `URI#host` of the referer against that stored value, so it can never match, and embedding from that site is silently refused although the admin UI accepted the host.
The postMessage origin check uses reversed substring matching (`discourseUrl.indexOf(e.origin) === -1`), accepting any origin that is a substring of the configured Discourse URL rather than requiring an exact origin match; impact is limited to letting a non-Discourse frame resize the embed iframe.
The test comment says the cached permissions 'allow access', but the map stores false for dashboards:uid:dash1, so checkPermission will still treat this scope as not allowed.
The context is being created with d.Log instead of the log variable that was initialized with additional context values (name, kind, method). This means those values won't be propagated to the logging context.
Cleanup reference uses incorrect alias - should be 'idp-alias-' + i instead of 'alias'.
Dead code exists where ASN1Encoder instances are created and written to, but their results are immediately discarded. The actual encoding is performed by new ASN1Encoder instances created in the subsequent return statement, rendering the earlier operations useless.
The dev server's `getStaticPaths` now copies each dynamic route's static paths and fallback mode into `<distDir>/prerender-manifest.json` with an unsynchronised readFile, JSON.parse, mutate, writeFile. Calls are coalesced only per pathname, so two different dynamic routes can resolve together. The second writer drops the first route's entries, and two overlapping truncating writes can leave the file as invalid JSON, after which every dev request that loads manifests throws until the dev server restarts.
The app-page template's responseGenerator copies base-server's static-shell-debugging short-circuit, which returns a cache entry of `kind: CachedRouteKind.PAGES`. The template's own handleResponse then throws "Invariant app-page handler received invalid cache entry PAGES" for any kind other than APP_PAGE. Base-server served that entry through its generic branch as an empty HTML response, so a static-shell debugging request now fails with the invariant error.
Breaking out of the loop when the deadline has elapsed can skip terminating remaining flusher processes, potentially leaving them running after shutdown; consider ensuring termination is attempted even if the deadline is exceeded.
With upsampling applied, events-stats sends the literal column `upsampled_count() as count` to the query builder. When the client also sets transformAliasToInputFormat=1, the builder's process_results renames the result key to that full input string, while the serializer looks up `count()` (resolve_axis_column returns the raw y-axis). `r.get(column, 0)` then finds nothing, so every bucket of the time series comes back as 0.
The new checklist mutations write no `activityLog` entry, while every other task-mutating operation does: `create`, `update` and `remove` in convex/tasks.ts each call `ctx.runMutation(internal.activity.log, ...)`. A task's checklist can therefore be changed with no record, leaving the activity history incomplete for that class of edit.
`addItem` takes `text: v.string()` and pushes it unchanged, so a blank or whitespace-only item is stored. The only guard is client-side, `if (!newChecklistItem.trim()) return` in TaskDetail.tsx, and a Convex mutation is a public API reachable without that component.
Both caught — 142
`getStatsForStmtWithKey` returns the nil zero value when the key is absent and `createIfNonexistent` is false, and the diff adds an early return in `recordStatement` that dereferences it unconditionally (`if !createIfNonExistent { return s.ID }`). A statement first seen at or below the configured latency threshold therefore panics with a nil pointer dereference.
New migration line 11 does `execute("...INNER JOIN site_settings...WHERE s.name='embed_category'")[0]['id']`, but installs that never overrode the `embed_category` setting (default '') have no such row, so the query returns zero rows and `[0]` raises IndexError, aborting the upgrade migration.
critical  Add response-pipeline webhook delivery job  cross-file  security
The new response-pipeline webhook delivery job (process-response-pipeline-job.ts) calls validateWebhookUrl(webhook.url) and then issues a plain fetchWithTimeout(webhook.url, ...) with no pinned dispatcher/agent and no manual redirect handling. The validate-then-default-fetch sequence leaves a DNS-rebinding TOCTOU window (the URL re-resolves on the real request) and follows 30x redirects, so an attacker-controlled webhook can reach internal services and cloud metadata endpoints (SSRF). Fixed by #8095 by pinning the resolved IP via a custom dispatcher and setting redirect to manual on delivery.
RouteCard() is changed to send Amex to the Adyen gateway instead of Stripe — a plausible routing tweak with no local smell. But the unchanged consumer capabilities.go records that this service's Adyen integration only handles Visa and Mastercard, so Amex payments routed there can no longer be processed. Whether the legacy gateway supports Amex is a codebase-specific fact stated only in the unchanged Supports(); a diff-only reviewer has no basis to know the reroute is wrong.
BuildFromKeys() is changed to reuse one scratch buffer for every end key — a normal-looking allocation optimization in isolation. But the unchanged writer.go Record() stores the slices as-is (no copy), so every entry's End aliases that single reused buffer and, after the loop, reads back as the LAST key — silently corrupting all the earlier spans. The diff looks fine on its own; the bug is only knowable by reading the unchanged Record() in writer.go to see it retains the slice. No panic.
The guard is tightened from `IntervalMs < 0` to `IntervalMs <= 0`, which reads like harmless input validation in the diff. But interval 0 means "unthrottled — fire on every call", and the unchanged consumer heartbeat.go deliberately builds a Limiter with interval 0 so its keepalive beats on every tick. Folding 0 into the rejected case makes that heartbeat never beat. The diff looks reasonable alone; the bug is only knowable by reading the unchanged heartbeat.go to see that interval 0 is an intended, load-bearing configuration.
The diff changes the contract of Handler.validate (beacon/handlers/base.py): it used to raise RecordRejected to reject a record with its return value ignored, and now returns True to keep a record and False to skip it, with run() doing `if not keep: result.skipped += 1; continue`. It moves the five handlers that skip expected traffic (pageview, click, login, email, experiment) to `return True`. RefundHandler (beacon/handlers/refund.py), which the diff never touches or names, also overrides validate: it calls super().validate(record), raises on a bad record and otherwise falls off the end, returning None. run() reads None as "skip", so every valid refund is counted as skipped and never becomes a row: net revenue on the warehouse side silently stops subtracting refunds, with nothing rejected and no error. The handlers are found only through the registry Handler.__init_subclass__ fills, so no call edge leads to refund.py, and the other untouched overriders (signup, purchase, subscription) end with `return super().validate(record)` and are fine, so every overrider has to be read. The project's history shows the habit the diff breaks: each earlier change to a hook's contract in base.py (check renamed to validate, transform returning the row, RecordRejected instead of ValueError) changed every handler overriding that hook in the same commit, refund.py included.
The diff changes the contract of Handler.validate (beacon/handlers/base.py): it used to raise RecordRejected to reject a record with its return value ignored, and now returns True to keep a record and False to skip it, with run() doing `if not keep: result.skipped += 1; continue`. It moves the five handlers that skip expected traffic (pageview, click, login, email, experiment) to `return True`. RefundHandler (beacon/handlers/refund.py), which the diff never touches or names, also overrides validate: it calls super().validate(record), raises on a bad record and otherwise falls off the end, returning None. run() reads None as "skip", so every valid refund is counted as skipped and never becomes a row: net revenue on the warehouse side silently stops subtracting refunds, with nothing rejected and no error. The handlers are found only through the registry Handler.__init_subclass__ fills, so no call edge leads to refund.py, and the other untouched overriders (signup, purchase, subscription) end with `return super().validate(record)` and are fine, so every overrider has to be read.
load_flags() returns None when the config string is empty instead of an empty set. The unchanged consumer gate.is_enabled() does `flag in load_flags(raw)`, so an empty config raises `TypeError: argument of type 'NoneType' is not iterable`. The diff looks fine in isolation — the break is only visible through the unchanged consumer gate.py.
The diff makes valid_entries() drop empty entries — a plausible cleanup. But the unchanged consumer audit.stamped() zips the result with `timestamps`, which remain parallel to the ORIGINAL entries. Dropping an entry shifts the rest, so entries are paired with the wrong timestamps. No exception is raised; the break is only visible through the unchanged consumer audit.py.
The diff adds geocoder_url to Settings as a required field (TRACKER_GEOCODER_URL, no default), so Settings.from_env raises MissingSettingError when it is unset, and wires it into build_service. In production the only TRACKER_* variables a pod gets are the ones the Helm chart's ConfigMap renders from config: in values.yaml, and neither deploy/helm/parcel-tracker/templates/configmap.yaml nor values.yaml gains the new variable. Every pod of the next deploy crashes at startup. The tests pass because they build the environment by hand. Nothing in the diff references the chart. The project's history shows every earlier new setting (redis URL, cache TTL, carrier API URL, max batch, request timeout) added it to settings.py, values.yaml and the ConfigMap template in the same commit.
The diff adds geocoder_url to Settings as a required field (TRACKER_GEOCODER_URL, no default), so Settings.from_env raises MissingSettingError when it is unset, and wires it into build_service. In production the only TRACKER_* variables a pod gets are the ones the Helm chart's ConfigMap renders from config: in values.yaml, and neither deploy/helm/parcel-tracker/templates/configmap.yaml nor values.yaml gains the new variable. Every pod of the next deploy crashes at startup. The tests pass because they build the environment by hand. Nothing in the diff references the chart.
The diff appends a uint16 accuracy_m to the backend's fixed-size little-endian location record (tracker/wire.py), growing it from 22 to 24 bytes, and updates the Python round-trip tests. The TypeScript client (client/src/decode.ts), which decodes the same records for the tracking page, is not touched: its RECORD_SIZE is still 22 and its layout has no accuracy field. A batch the backend now produces is rejected by decodeBatch whenever its length is not a multiple of 22, and otherwise every record after the first is read from the wrong offset. Nothing in the diff references the client. The project's history shows the pairing: every earlier change to the record layout (speed, heading, microdegree coordinates, battery) changed wire.py and client/src/decode.ts in the same commit, and the one that didn't (the status byte) was followed by a client commit decoding it.
The diff appends a uint16 accuracy_m to the backend's fixed-size little-endian location record (tracker/wire.py), growing it from 22 to 24 bytes, and updates the Python round-trip tests. The TypeScript client (client/src/decode.ts), which decodes the same records for the tracking page, is not touched: its RECORD_SIZE is still 22 and its layout has no accuracy field. A batch the backend now produces is rejected by decodeBatch whenever its length is not a multiple of 22, and otherwise every record after the first is read from the wrong offset. Nothing in the diff references the client.
The diff changes the shape of the shipment payload (destination_city and destination_country become a nested destination object) and updates TrackingService.summary to read the new shape, but leaves CACHE_VERSION in tracker/cache.py at 6. The cache is Redis, shared by every replica and outliving a deploy, and CACHE_VERSION is part of every key. After this ships, the new code reads payloads the previous release cached under the same v6 keys, in the old flat shape, and summary() raises KeyError for every shipment still cached until the entries expire. Nothing in the diff references cache.py. The project's history shows every earlier payload change (status enum, eta, carrier, destination, weight) bumped CACHE_VERSION in the same commit.
The diff changes the shape of the shipment payload (destination_city and destination_country become a nested destination object) and updates TrackingService.summary to read the new shape, but leaves CACHE_VERSION in tracker/cache.py at 6. The cache is Redis, shared by every replica and outliving a deploy, and CACHE_VERSION is part of every key. After this ships, the new code reads payloads the previous release cached under the same v6 keys, in the old flat shape, and summary() raises KeyError for every shipment still cached until the entries expire. Nothing in the diff references cache.py.
The diff gives check the canonical values the checks compare: Channel.run() (portside/channels/base.py) now calls check with `{**record, **self.canonical(record)}` and passes prepare the partner's record as before. Each family base already had a canonical(), which run() logs with every reject: it reads the SKU, quantity, currency and (for storefronts) email from the partner's fields, normalised the way prepare does, through readable() (portside/channels/fields.py), and each family's check ends by reading them strictly, so a channel's own check only runs on a line whose canonical values can be read. The diff changes no hook's signature or return contract and no family base, and the seven channel checks that read one of those fields under another name or normalised it themselves read the canonical value instead. For an EDI line, EdiChannel.canonical() (portside/channels/edi/base.py), which the diff doesn't touch, sets `"quantity": units(record["quantity"], record["uom"], record.get("pack"))`, the canonical quantity prepare also writes through line_totals() (fields.py): the PO line's quantity as ordered (in cases for a CS line) times the pack size. PinecrestChannel.check (portside/channels/edi/pinecrest.py), which the diff doesn't touch, rejects a line when `parse_quantity(record["quantity"]) > self.MAX_QUANTITY` (150), a cap on what one PO line orders that catches a UPC sent in the quantity field. It now compares units against that cap, so every Pinecrest case line over 150 units (13 cases of 12, 26 cases of 6) is rejected as "more than 150 ordered", and those purchase orders are dropped from the warehouse as partner errors. Nothing in the class is wrong on its own and the repo's Pinecrest test (6 cases of 12) passes either way. The other canonical values hold for every check that reads them: a marketplace quantity (Tessera's cap) is only parsed to an int, the register amounts aren't canonicalised, and the SKU, currency and email checks see the same normalisation prepare applies, which changes their outcome only for the partner formats the PR is for. The project's history shows the habit the diff breaks: each earlier change to how run() calls the stages (stripping text fields before them, running them from the `stages` list, keeping one channel instance per process) changed, in the same commit, the channels that depended on the old behaviour (Kestrel's PO-length check for the stripping, Tillwise's per-file state for the shared instance).
The diff gives check the canonical values the checks compare: Channel.run() (portside/channels/base.py) now calls check with `{**record, **self.canonical(record)}` and passes prepare the partner's record as before. Each family base already had a canonical(), which run() logs with every reject: it reads the SKU, quantity, currency and (for storefronts) email from the partner's fields, normalised the way prepare does, through readable() (portside/channels/fields.py), and each family's check ends by reading them strictly, so a channel's own check only runs on a line whose canonical values can be read. The diff changes no hook's signature or return contract and no family base, and the seven channel checks that read one of those fields under another name or normalised it themselves read the canonical value instead. For an EDI line, EdiChannel.canonical() (portside/channels/edi/base.py), which the diff doesn't touch, sets `"quantity": units(record["quantity"], record["uom"], record.get("pack"))`, the canonical quantity prepare also writes through line_totals() (fields.py): the PO line's quantity as ordered (in cases for a CS line) times the pack size. PinecrestChannel.check (portside/channels/edi/pinecrest.py), which the diff doesn't touch, rejects a line when `parse_quantity(record["quantity"]) > self.MAX_QUANTITY` (150), a cap on what one PO line orders that catches a UPC sent in the quantity field. It now compares units against that cap, so every Pinecrest case line over 150 units (13 cases of 12, 26 cases of 6) is rejected as "more than 150 ordered", and those purchase orders are dropped from the warehouse as partner errors. Nothing in the class is wrong on its own and the repo's Pinecrest test (6 cases of 12) passes either way. The other canonical values hold for every check that reads them: a marketplace quantity (Tessera's cap) is only parsed to an int, the register amounts aren't canonicalised, and the SKU, currency and email checks see the same normalisation prepare applies, which changes their outcome only for the partner formats the PR is for.
The diff changes position_of()'s not-found sentinel from None to -1 (a plausible convention). The unchanged consumer router.route_for() still guards with `if idx is None`, so an unknown name no longer hits the default — it falls through to handlers[-1] and is silently routed to the LAST handler. No exception is raised; the break is only visible through the unchanged consumer router.py.
The diff changes the keyset filter from a direct timestamp comparison to `day_bucket(event.ts) >= cursor`, which reads as a reasonable move to day-granularity pagination. But the unchanged day_bucket (timeutil.py) truncates in SESSION_TZ (a non-UTC offset), while the unchanged cursor (cursor.py, parse_cursor) is a UTC day-start. The two sides of the comparison then sit on different day grids: a row a few hours after UTC midnight buckets to the previous day under the negative-offset session, drops below the UTC cursor, and vanishes from the next page (often emptying it). Neither file is wrong alone; the bug is the grid mismatch between the session-tz day_bucket and the UTC-pinned cursor that the new filter brings together.
The diff changes the contract of Handler.validate (sightline/handlers/base.py): it used to raise RecordRejected to reject a record with its return value ignored, and now returns True to keep a record and False to skip it, with run() doing `if not keep: result.skipped += 1; continue`. It adds `return True` to every handler whose validate fell off the end, and turns the expected-traffic rejects into `return False`. It leaves alone the handlers whose validate already ended with a return: the family bases (`return super().validate(record)`), the 25 handlers that end `return present(record, self.kind, ...)` (sightline/fields.py), which returns True or raises, and RefundHandler (sightline/handlers/billing/refund.py), whose validate ends `return note_missing(record, self.kind, "reason")`. note_missing() logs the optional fields a record lacks and returns their names, so for a refund that has a reason it returns an empty list. That was harmless while validate's return value was ignored; now run() reads the empty list as "skip", and every refund that carries a reason (all of them, in practice) never becomes a row: net revenue on the warehouse side silently stops subtracting refunds, with nothing rejected and no error. A refund without a reason is kept. The other handlers that call note_missing() call it as a statement and now return True after it. The handlers are found through the registry that Handler.__init_subclass__ fills. The money family base's @audited wrapper returns the hook's result for reversals and other records alike, and overrides of validate carry no return annotation, so neither shows the contract either way. The project's history shows the habit the diff breaks: each earlier change to a hook's contract in base.py (check renamed to validate, transform returning the row, RecordRejected instead of ValueError) changed every class defining that hook in the same commit, the family bases in sightline/kinds/ included.
The diff changes the contract of Handler.validate (sightline/handlers/base.py): it used to raise RecordRejected to reject a record with its return value ignored, and now returns True to keep a record and False to skip it, with run() doing `if not keep: result.skipped += 1; continue`. It adds `return True` to every handler whose validate fell off the end, and turns the expected-traffic rejects into `return False`. It leaves alone the handlers whose validate already ended with a return: the family bases (`return super().validate(record)`), the 25 handlers that end `return present(record, self.kind, ...)` (sightline/fields.py), which returns True or raises, and RefundHandler (sightline/handlers/billing/refund.py), whose validate ends `return note_missing(record, self.kind, "reason")`. note_missing() logs the optional fields a record lacks and returns their names, so for a refund that has a reason it returns an empty list. That was harmless while validate's return value was ignored; now run() reads the empty list as "skip", and every refund that carries a reason (all of them, in practice) never becomes a row: net revenue on the warehouse side silently stops subtracting refunds, with nothing rejected and no error. A refund without a reason is kept. The other handlers that call note_missing() call it as a statement and now return True after it. The handlers are found through the registry that Handler.__init_subclass__ fills. The money family base's @audited wrapper returns the hook's result for reversals and other records alike, and overrides of validate carry no return annotation, so neither shows the contract either way.
The diff makes team_members() return members sorted by name — a plausible improvement with no caller-facing red flag. But the unchanged consumer payroll.pay_slips() zips the names with `amounts`, which remain in the members' original order. After sorting, names and amounts no longer align and everyone is paid the wrong amount. No exception is raised; the break is a silently wrong mapping, visible only through the unchanged consumer payroll.py.
The diff switches worker creation from the default `multiprocessing.Process(...)` to `multiprocessing.get_context("spawn").Process(...)`, which reads as a sound fork-safety improvement. But the unchanged Reaper.reap() in reaper.py gates its kill on `isinstance(process, multiprocessing.Process)`. Spawn-context workers are SpawnProcess instances, and `multiprocessing.Process` is the generic context.Process — a sibling BaseProcess subclass, not a base of SpawnProcess — so the gate is now always False and reap() silently kills nothing, leaking stalled flushers. The change looks correct in isolation; the regression is only visible by reading the unchanged reaper and knowing that spawn-context processes fail the isinstance check.
The change migrates the export pipeline to a binary sink: exporter.py now opens the file "wb", Serializer.serialize's contract is now bytes, and JsonSerializer was updated to .encode(). But CsvSerializer — an unchanged implementer of Serializer, reached only through SERIALIZERS["csv"] and never named anywhere in the diff — still returns str. export("csv", ...) therefore writes a str to a binary file and raises TypeError at runtime. This is the grep-blind class of cross-file bug: a name-grep of the diff's changed symbols (export, JsonSerializer, Serializer) never reaches CsvSerializer; finding it requires resolving the implementers of the Serializer interface (a symbol edge), then checking each still satisfies the tightened contract.
The diff makes normalize_tags() lowercase tags — a plausible normalization. But the unchanged consumer access.is_admin() compares against the capitalized literal "Admin", so after lowercasing the membership test never matches and every admin silently loses admin status. No exception is raised; the change looks like a clean improvement in isolation and the break is only visible through the unchanged consumer access.py.
The diff swaps `chunks` for `chunks_exact` in encode() — a real optimisation, and the two read as interchangeable at the call site. They are not: `chunks_exact` discards the remainder when the slice length is not a multiple of the chunk size, handing it to a separate `remainder()` the diff never calls. Whether that matters is a fact about the CALLER, and the unchanged consumer collector.rs states it: a flush is driven by the device's reporting schedule, so a batch is a multiple of FRAME_SAMPLES only by coincidence and its last frame is normally partial. After this change the tail of every batch — up to FRAME_SAMPLES - 1 samples — is dropped on the floor. Nothing errors and no frame is malformed; telemetry is just quietly incomplete, and the loss is only knowable by reading the unchanged collector.
The diff adds a `queue` field to Job and moves `queue` and `name` above `priority` — a grouping change with no local smell, and the struct carries no comment about its field order. But Job derives Ord, and a derived Ord compares fields in DECLARATION order, so the ranking the struct exposes is now name-first. The unchanged consumer queue.rs is a BinaryHeap whose whole scheduling policy is `pop()` returning the greatest Job: it has no comparator of its own and relies on the derive ranking by priority. After the reorder the scheduler hands out jobs in reverse alphabetical order, so an idle cleanup job preempts an urgent payment. Nothing fails to compile and no error is raised — the ranking is simply wrong, and the break is only knowable by reading the unchanged queue.rs to see that `Ord` IS the scheduling policy.
The diff adds tenant scoping to build_digest with `let _ = ctx.enter(tenant);`. In Rust `let _ = expr` is not a binding — it discards the value immediately, so the guard's Drop runs at the end of that statement and the tenant is no longer current on the very next line. (`let _scope = ...` would hold it for the body.) The same form also suppresses the `#[must_use]` on `enter`, so the one warning that would have caught it never fires. The unchanged store.rs then decides what an unscoped read means, and it is documented there: an unscoped caller is the maintenance context, so visible_rows returns a FULL TABLE rather than nothing. Every tenant's rows land in every tenant's digest — a cross-tenant data leak that compiles clean, raises nothing, and looks in the diff exactly like the scoping it is missing.
The diff changes what Handler.transform's return value means (handler.ts): it used to be "adjust the default row in place, or return a replacement", with run() posting `this.transform(event, row) ?? row`, and now returning nothing drops the event, with run() doing `if (!row) { result.skipped += 1; continue; }`. It adds `return row` to the five handlers it moves to the new contract (charge.succeeded, charge.refunded, payout.paid, fee.assessed, invoice.paid). DisputeCreatedHandler (dispute-created.handler.ts), which the diff never touches or names, also overrides transform: it sets the disputes account, the negated amount and the memo on the row in place and returns nothing. run() now reads that as "drop", so every charge.dispute.created event is counted as skipped and the amount the provider holds back never reaches the ledger: the disputes account and the reconciliation against the provider balance are silently off by every open dispute, with nothing rejected. The hook's declared return type stays `LedgerRow | void`, so tsc accepts the unchanged override. The handlers are reached only through registry.ts, which the diff doesn't touch, and the other untouched handlers are fine (dispute-reinstated adjusts in place and already returns the row; transfer-created, balance-adjusted and credit-note-issued return a replacement; payout-failed doesn't override transform), so every handler has to be read. The project's history shows the habit the diff breaks: each earlier change to a hook's contract in handler.ts (validate throwing InvalidEvent instead of returning a reason, transform adjusting a default row instead of toRow building one) changed every handler overriding that hook in the same commit, dispute-created.handler.ts included.
The diff changes what Handler.transform's return value means (handler.ts): it used to be "adjust the default row in place, or return a replacement", with run() posting `this.transform(event, row) ?? row`, and now returning nothing drops the event, with run() doing `if (!row) { result.skipped += 1; continue; }`. It adds `return row` to the five handlers it moves to the new contract (charge.succeeded, charge.refunded, payout.paid, fee.assessed, invoice.paid). DisputeCreatedHandler (dispute-created.handler.ts), which the diff never touches or names, also overrides transform: it sets the disputes account, the negated amount and the memo on the row in place and returns nothing. run() now reads that as "drop", so every charge.dispute.created event is counted as skipped and the amount the provider holds back never reaches the ledger: the disputes account and the reconciliation against the provider balance are silently off by every open dispute, with nothing rejected. The hook's declared return type stays `LedgerRow | void`, so tsc accepts the unchanged override. The handlers are reached only through registry.ts, which the diff doesn't touch, and the other untouched handlers are fine (dispute-reinstated adjusts in place and already returns the row; transfer-created, balance-adjusted and credit-note-issued return a replacement; payout-failed doesn't override transform), so every handler has to be read.
The diff changes how handlers are built and called: ingestEvents (ingest.ts) used to call createHandler, which built a new handler for every event, and now calls handlerFor (registry.ts), which builds one handler per event type and HandlerContext on first use and hands every later event of that type to the same instance; it updates the lifetime in the Handler doc comment and docs/handlers.md. Handler.run() already started every event with an empty postings list and a new copy of the event, and no hook's signature or contract changes. PayoutPaidHandler (payout-paid.handler.ts), which the diff doesn't touch, charges the flat payout fee through `this.ctx.fees.payout(this).charge(line.account, line.currency)`. The fee schedule (FeeSchedule in fees.ts), also untouched, keeps one PayoutFees per owner in a WeakMap, so the PayoutFees payout.paid asks for lives exactly as long as the handler. PayoutFees (payout-fees.ts) remembers the accounts it has charged in a Set and returns the flat fee only the first time it sees an account, which implemented the pricing rule "once per seller in a payout" (FeeTable's payoutFlat in fees.ts, and the payout test) while each payout got a new handler and so a new owner. With one handler for every payout.paid event, a seller is charged on their first payout after the process starts and never again: every later payout posts no payout fee, with no error or reject, and the platform's payout fee revenue and the sellers' balances are off by the fee on every repeat payout. Nothing in the class is wrong on its own, and the repo's payout tests pass (each ingests a single payout). Nothing else a shared handler holds changes behaviour: InstantPayoutHandler asks the fee schedule for the event's PayoutFees (`payout(event, speed)`), so its sellers are charged once per payout either way; the 48 rule handlers' WarnOnce and charge.captured's and transfer.created's LineDedupe hold Sets of keys but clear them when they see a new event object, which run() makes for every event; and the rate cache is the context's, which ingest shared before the change too. The handlers are reached only through the HANDLERS table in registry.ts. The project's history shows the habit the diff breaks: each earlier change to how the base class calls the hooks (a finish() hook after the last line, currencies lower-cased before the hooks) changed, in the same commit, the handlers that depended on the old calling behaviour (dispute.lost and payout.failed, which detected the last line themselves; tax.collected and climate.contribution, which compared upper-case codes).
The diff changes how handlers are built and called: ingestEvents (ingest.ts) used to call createHandler, which built a new handler for every event, and now calls handlerFor (registry.ts), which builds one handler per event type and HandlerContext on first use and hands every later event of that type to the same instance; it updates the lifetime in the Handler doc comment and docs/handlers.md. Handler.run() already started every event with an empty postings list and a new copy of the event, and no hook's signature or contract changes. PayoutPaidHandler (payout-paid.handler.ts), which the diff doesn't touch, charges the flat payout fee through `this.ctx.fees.payout(this).charge(line.account, line.currency)`. The fee schedule (FeeSchedule in fees.ts), also untouched, keeps one PayoutFees per owner in a WeakMap, so the PayoutFees payout.paid asks for lives exactly as long as the handler. PayoutFees (payout-fees.ts) remembers the accounts it has charged in a Set and returns the flat fee only the first time it sees an account, which implemented the pricing rule "once per seller in a payout" (FeeTable's payoutFlat in fees.ts, and the payout test) while each payout got a new handler and so a new owner. With one handler for every payout.paid event, a seller is charged on their first payout after the process starts and never again: every later payout posts no payout fee, with no error or reject, and the platform's payout fee revenue and the sellers' balances are off by the fee on every repeat payout. Nothing in the class is wrong on its own, and the repo's payout tests pass (each ingests a single payout). Nothing else a shared handler holds changes behaviour: InstantPayoutHandler asks the fee schedule for the event's PayoutFees (`payout(event, speed)`), so its sellers are charged once per payout either way; the 48 rule handlers' WarnOnce and charge.captured's and transfer.created's LineDedupe hold Sets of keys but clear them when they see a new event object, which run() makes for every event; and the rate cache is the context's, which ingest shared before the change too. The handlers are reached only through the HANDLERS table in registry.ts.
The diff changes what Handler.transform's return value means (handler.ts): it used to be "adjust the default row in place, or return a replacement", with run() posting `this.transform(event, row) ?? row`, and now returning nothing drops the event, with run() doing `if (!row) { result.skipped += 1; continue; }`. It adds `return row` to every handler whose transform adjusted the row in place and returned nothing, and makes charge.succeeded and invoice.paid drop zero amounts. It leaves alone the transforms that already end with a return: the family bases, the 21 payout and fee handlers that end `return withMemo(row, ...)` (annotations.ts), which sets the memo and returns the row, and DisputeCreatedHandler (dispute-created.handler.ts), whose transform calls `super.transform(event, row)` and ends `return noteMissing(event, "reason")`. noteMissing() logs the optional fields the event lacks and returns nothing (`: void`), which TypeScript accepts as a return from a transform typed `LedgerRow | void`. That was harmless while run() fell back to the adjusted row; now run() reads the undefined as "drop", and every charge.dispute.created event is counted as skipped: the amount the provider holds back never reaches the ledger, and the held-funds account and the reconciliation against the provider balance are silently off by every open dispute, with nothing rejected. The other handlers that call noteMissing() call it as a statement and now return the row after it. The HeldFunds mixin's @audited transform returns the hook's result for held funds and other rows alike. The handlers are reached only through registry.ts, which the diff doesn't touch. The project's history shows the habit the diff breaks: each earlier change to a hook's contract in handler.ts (validate throwing InvalidEvent instead of returning a reason, adjust(row, event) renamed transform(event, row)) changed every class and mixin defining that hook in the same commit, and the rename changed audit.ts with them.
The change narrows shouldShowSyncColumns() with `&& conn.supportsColumnSelection`, which is correct for the column-selection control. But the unchanged consumer wizard.ts uses that same gate to show the sync-method and primary-key controls too. For any connector that does not support column selection, those two controls now silently disappear, so the user can no longer choose incremental vs full-refresh sync. The fix is a separate gate for column selection.
The change adds the assertSameEnv() environment-scoping guard to the create() and update() mutations, but the sibling remove() on the same controller is left unguarded. An API key scoped to one environment can therefore delete an integration in another environment of the same org (a cross-environment IDOR). The vulnerable line is the unchanged remove(): the diff shows the guard being added to its siblings, not to it.
The diff adds `assertSameEnv(keyEnv, integ.environmentId)` to `update()`, validating the integration's CURRENT environment, and the next line spreads the caller-supplied patch unfiltered (`this.store.set(id, { ...integ, ...patch })`). `patch` is `Partial<Integration>` and `Integration` declares `environmentId`, so the caller can overwrite the very field the guard is scoped on -- the guard checks the pre-image and then permits a cross-environment write.
The diff stops navigating inside serverActionReducer and instead stages the redirect on the returned state (`pendingMpaNavigation`), which reads as a clean refactor to centralize navigation in the render commit. The Store.dispatch path still works because it calls commit() after reducing. But the unchanged applyServerActionResult (store.ts) — used when a server action result resolves outside the React tree — reduces the action and returns the new state without ever committing it, so the staged navigation is never performed and the external redirect is silently dropped. The diff looks correct in isolation; the regression only shows on the unchanged code path that never reaches commit().
Potential null reference if mainHostDestinationCalendar is undefined if evt.destinationCalendar is null or an empty array
Logic inversion in organization creation: The slug property is now conditionally set when IS_TEAM_BILLING_ENABLED is true, instead of when it's false as originally intended. This change, combined with requestedSlug still being set when IS_TEAM_BILLING_ENABLED is true, results in both properties being set when billing is enabled, and neither when disabled
At handleNewBooking.ts:1063-1067 evt.destinationCalendar is set to null when neither eventType nor organizerUser has a destinationCalendar, so the COLLECTIVE branch's `evt.destinationCalendar?.push(...teamDestinationCalendars)` (line 1078) short-circuits to a no-op, silently discarding all team members' destinationCalendars and producing no calendar events for them.
EventManager.ts:170 now writes credentialId: undefined for video booking references (was result.credentialId from videoClient.ts:78), so handleCancelBooking.ts:491's `if (bookingVideoReference.credentialId)` guard is always false and the external video meeting is never deleted on cancellation.
The parseRefreshTokenResponse function incorrectly sets refresh_token to the hardcoded string 'refresh_token' when it's missing from the OAuth refresh token response. This invalidates the token, breaking subsequent token refreshes and causing authentication failures.
Both computed keys in minimumTokenResponseSchema stringify to the identical literal "[object Object]", so the schema collapses to {access_token} and silently strips every other field (expiry, refresh_token) from synced token-refresh responses.
parseRefreshTokenResponse returns a Zod safeParse result ({ success, data, error }), not the credential key object. Persisting that as key stores the wrapper instead of the token payload; we should store the parsed data or use schema parse.
When APP_CREDENTIAL_SHARING_ENABLED and CALCOM_CREDENTIAL_SYNC_ENDPOINT are set, the refreshFunction helper returns the fetch Response, but several callers (for example GoogleCalendarService.refreshAccessToken expecting res.data, and HubspotCalendarService.refreshAccessToken expecting a HubspotToken) assume it returns the integration-specific token object. That mismatch will cause runtime errors in the sync-enabled path unless the return type or those call sites are adjusted.
When the sync endpoint path is used, res is a fetch Response and has no .data; res?.data will be undefined and token.access_token will throw at runtime. This relies on a consistent return shape from refreshOAuthTokens, which isn’t guaranteed currently.
The deleteMany OR-arm `retryCount: { gt: 1 }` has no method or scheduledDate filter, so an SMS reminder retried more than once is deleted even when its scheduled date is still in the future, prematurely removing pending reminders.
The new date-override block is inserted ahead of the availability test that ends `checkIfIsAvailable` (`return busy.every(...)`). When a slot falls inside an override window the `find` callback sets `dateOverrideExist` and returns undefined, so `.find()` matches nothing, the outer branch is skipped, and `if (dateOverrideExist) return true` reports the slot bookable without ever evaluating `busy`. A slot inside a date override is offered even when it collides with an existing booking.
The new working-hours guard uses `workingHours.find(...)` and returns false as soon as ANY entry for that weekday excludes the slot, so the test is `some entry rejects it` rather than `no entry accepts it`. `getWorkingHours` emits one entry per availability row plus an overflow entry for the adjacent day, so multiple same-day entries are routine and each rejects the others' slots.
sameElidedPrefix(newSpan.Key, lastFile.Span.EndKey, ...) is structurally always true in the contiguous-extend path, since isContiguousSpan requires newSpan.Key == lastFile.Span.EndKey by definition -- comparing ElidedPrefix(X) to itself. The guard therefore cannot fire on the exact path it exists to protect: extending a manifest file across a contiguous span whose elided prefix differs from s.elidedPrefix silently mislabels the entry's key-strip prefix, corrupting restore for ordinary backup shapes (a table's span ending where the next table's begins). Distinct from d1 -- same function, different mechanism. The sibling file_sst_sink.go compares spanPrefix against s.elidedPrefix directly and does not have this bug.
getDeleter re-acquires when `!timestamp.After(expiration)` (timestamp <= expiration), which is the lease's valid range, so it re-leases every call while valid and reuses the expired descriptor (setting a past UpdateDeadline) once timestamp > expiration — inverted relative to hasExpired's `expiration.LessEq(timestamp)`.
`updateTombstone` guards with `if err != nil && isLwwLoser(err)` and then re-tests `if isLwwLoser(err)` inside that branch, which is always true, making the `return batchStats{}, err` arm unreachable. The consequence is the fall-through: any genuine error (addToBatch failure, `txn.KV().Run` failure, a lease error) fails the outer condition and reaches `return batchStats{}, nil`, reporting success on a failed tombstone update.
The refactor moved the interval guard into canSave as `if interval <= 0 { return false }`, but min_checkpoint_frequency=0 is a valid setting meaning 'save as often as possible.' `<= 0` folds the zero case into the disabled case, so the changefeed highwater never advances and resolved timestamps are never emitted. The fix is `<= 0` -> `< 0`.
The rewrite narrows how a package's bin entry is chosen. `resolve_bin_entry_value` used to take `bin_name: Option<&str>` and treat `None` — no subpath given — as its own case: with a single bin entry it returned that entry whatever its key. The new caller resolves a name eagerly before the lookup (`match sub_path { Some(n) => n, None => pkg_json.resolve_default_bin_name()? }`) and passes a plain `&str`, so `None` no longer reaches the lookup and the single-entry case is gone. The default bin name is derived from the package name, which for a scoped package is the part after the slash — so any package whose one bin entry is named something other than the tail of its own name stops resolving. It is not a rare shape: `npm:@arethetypeswrong/cli` has a single bin called `attw`, and after this change `deno run -A npm:@arethetypeswrong/cli` fails outright with "did not have a bin entry for 'cli'". The regression is invisible in the diff's own tests because the fixtures it adds (`@denotest/directories-bin`, bin `cli`) are all packages whose bin key does match the name.
The TopicEmbed.import method is susceptible to a NoMethodError if the contents parameter is nil when attempting to append a string, and an XSS vulnerability due to unescaped url interpolation in the generated HTML.
poll_feed.rb passes raw third-party feed HTML to TopicEmbed.import with cook_method raw_html, which post.rb's cook() returns verbatim without sanitization (unlike import_remote's Readability whitelist), and best.html.erb renders it via `raw post.cooked` on a Discourse-origin page with X-Frame-Options ALLOWALL — yielding stored XSS from `<script>` in a feed item.
In the new Index.check() (django/db/models/indexes.py), the local-field validation passes the raw self.fields set to model._check_local_fields: "{*self.fields, *self.include, *references}". self.fields keeps the leading "-" descending-ordering prefix, whereas the old Model._check_indexes built the field list from index.fields_orders (which strips the prefix). So an index declared with a descending field, e.g. Index(fields=["-author"]), is looked up as "-author", fails to match the real "author" field, and raises a spurious models.E012 ("indexes refers to the nonexistent field -author") on a perfectly valid model.
This PR adds a filter on the Mixed-DS path that completes the time-range-change stream on the first terminal emission whose range matches, but it compares the upstream terminal emission's range against `options.range` (the chain request range) via `isSameRange(upstreamRange, options.range)`. When a source panel carries a PanelTimeRange override, the upstream legitimately runs for the source panel's own range, which differs from the chain range, so the matching terminal Done is dropped and the Mixed panel is stuck in permanent loading. The comparison should use the source panel's effective range (read via sceneGraph.getTimeRange), not the chain range.
All four write methods now hand the legacy write to a goroutine whose context descends from the request context (`context.WithTimeoutCause(ctx, ...)`). net/http cancels the request context as soon as the handler returns, and the goroutine starts microseconds before that, so the legacy write is aborted mid-flight on essentially every request and unified storage silently diverges from legacy storage.
Limited consistent LISTs bypass the watch cache and hit etcd. For a consistent read the delegator sets `opts.ResourceVersion` to the current etcd RV, so in `watchCache.list` the new "legacy exact match" branch (`Limit > 0 && len(opts.ResourceVersion) > 0 && opts.ResourceVersion != "0"`) now matches and routes the request to `listExactRV`. With `ListFromCacheSnapshot` off (its default) the snapshot store is nil, so `listExactRV` returns `ResourceExpired` and the delegator falls back to etcd. The net effect is that in the default config every consistent LIST that carries a limit (e.g. `GET /pods?limit=500`) now bypasses the cache and queries etcd directly; even with snapshots enabled it drops the index-based prefiltering that `listLatestRV` would apply.
Incorrect permission check in canManage() method
In getGroupIdsWithViewPermission, hasPermission is called with groupResource.getId() and the same groupResource.getId() is added to granted, but hasPermission resolves resources by name (treating the argument as a group id) and the GroupPermissionEvaluator contract says this method returns group IDs that are later used as UserModel.GROUPS and in getUsersCount group filters. This mismatch means per-group VIEW_MEMBERS/MANAGE_MEMBERS permissions may not yield the expected group IDs for filtering and counts, and evaluation may effectively only look at the type-level 'all-groups' resource; consider revisiting whether this should operate on the underlying group ids (resource names) instead so it aligns with the JPA queries and the interface contract.
With isConditionalPasskeysEnabled(UserModel user) requiring user != null, authenticate(...) will not call webauthnAuth.fillContextForm(context) on the initial login page where context.getUser() is still null, so conditional passkey UI will not be set up for first-time passkey login. Consider whether this should also be enabled when no user has been selected yet so ID-less passkey authentication on the initial login form continues to work.
In the standalone-without-sharp guard inside imageOptimizer's Squoosh-fallback branch, the deliberate `throw new ImageError(500, 'internal server error')` (meant to hard-fail when 'sharp' isn't installed in standalone mode) is caught by the enclosing try/catch, which returns { buffer: upstreamBuffer, contentType: upstreamType!, maxAge } instead of propagating the error. The old code sent a real 500 directly (`req.statusCode = 500; res.end(...); return { finished: true }`); this diff's rewrite routes the same guardrail through a throw that gets silently swallowed, so standalone mode without sharp serves a 200 with the original, unoptimized image instead of failing loudly.
In app-page.ts the resume-render branch calls getFallbackRouteParams(pathname) where pathname (parsedUrl.pathname, interpolated in prepare()) is the resolved concrete path with no [param] segments, so getRouteRegex finds no dynamic keys and returns null; it should use normalizedSrcPage (the route pattern) as the sibling PPR-fallback call and the original base-server pathname (match.definition.pathname) did, breaking PPR fallback-shell param postponement for dynamic routes when renderFallbackShell is set in production.
In the app-route template's on-demand-revalidate path, responseGenerator correctly writes a real 404 response (res.statusCode = 404; res.end(...)) and returns null when isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry. Back in handleResponse, because this route is ISR-eligible (isIsr is true -- it's determined solely by prerender-manifest membership, independent of the on-demand-revalidate flags, and on-demand revalidation is inherently an ISR-only feature), the `if (!isIsr) return null` short-circuit is skipped, and cacheEntry?.value?.kind !== CachedRouteKind.APP_ROUTE (true, since cacheEntry is null) throws an "Invariant: app-route received invalid cache entry" error -- even though a valid 404 HTTP response was already sent to the client. Because isIsr is true, the surrounding catch re-throws this spurious error rather than swallowing it, propagating it up through base-server onto an already-ended response.
The new Java stream-reader adapter stores the `JNIEnv*` it is handed in its constructor and reuses it from `read`, `seek` and its destructor. A `JNIEnv*` is only valid on the thread that obtained it, but these callbacks run on other threads: the generated Java wrapper's `finalize()` deletes the native object on the JVM finalizer thread, and a capture opened on one Java thread can be read from another. JNI calls then go through an env pointer that is invalid on the calling thread, which is undefined behavior and can abort or crash the JVM.
With CDP_EMAIL_QUEUE_ROUTING on, a workflow's email step now routes the invocation to the new `email` cyclotron queue, the hog_function action copies that queue onto the flow invocation, and the email worker (a hogflow worker on queue `email`) sends the email and keeps running the flow. A `wait_until_condition` step after it therefore parks the job with queue_name='email', which job-queue-postgres-v2 now persists. The hogflow subscription matcher, unchanged by this diff, wakes parked waits through findParkedJobs, which only looks up `queue_name = 'hogflow'`. It never finds the wait, so a matching event does not advance the workflow and it resumes only on the wait's timeout branch.
hiredis_read_internal stores the address of its stack-local reader_state in connection->context->reader->privdata. Ruby's YJIT can move execution to a different native stack while hiredis retains that pointer, so reply_append later dereferences invalid stack memory. Parsing a Redis response can then read a corrupt task_index pointer and crash the process with SIGSEGV.
In `src/sentry/utils/samples.py`, `measurements.update(measurement_markers)` is placed INSIDE the `for key, entry in measurements.items()` loop, mutating the dict that is being iterated. Adding the new `mark.*` keys mid-iteration raises `RuntimeError: dictionary changed size during iteration`, breaking `load_data` for any transaction that carries measurements. The fix dedents the update to run once after the loop.
Because flusher processes are created via multiprocessing.get_context('spawn').Process, they are instances of multiprocessing.context.SpawnProcess, which on POSIX is not a subclass of multiprocessing.Process, so this isinstance check will always be false and hung processes won't be killed here.
Per-group queues are created as unbounded `queue.Queue()` (queue_consumer.py:185) and `SimpleQueueProcessingStrategy.submit` always enqueues without ever raising `MessageRejected`, so when `result_processor` lags the inbound Kafka rate the consumer keeps decoding/enqueuing and accumulating uncommitted offsets without bound, growing memory until OOM — directly contradicting the docstring's 'Natural backpressure when queues fill up'.
SimpleQueueProcessingStrategy.close()/join()/terminate() (queue_consumer.py:335-342) call queue_pool.shutdown() on the factory-shared FixedQueuePool during arroyo's partition-revocation rebalance, so the next create_with_partitions reuses the now-shut-down pool whose work_queue.put() raises queue.ShutDown — swallowed by submit()'s broad except, which then marks offsets complete, silently dropping all messages and committing their offsets after the first rebalance.
When requests are authenticated with API keys or org auth tokens (which have user_id=None), organization_context.member is None. Line 71 attempts to access organization_context.member.has_global_access without checking if member is None, causing an AttributeError crash when optimized_pagination=true is used, even though the request passed all permission checks with valid org:write scope.
OptimizedCursorPaginator.get_item_key uses floor/ceil on a datetime key (order_by='-datetime'), causing TypeError.
In pkg/querybuilder/where_clause_visitor.go the new variable-recognition blocks in VisitComparison slice var_ with var_[1:] (to retry the variable lookup without a leading '$') guarded only by a string type assertion: "if var_, ok := value.(string); ok" / "if var_, ok := values[0].(string); ok". An empty string passes that assertion, and var_[1:] on "" panics with "slice bounds out of range [1:0]", crashing the request goroutine / query service. It is reachable: a filter expression value of '' (empty quoted literal) flows through VisitValue -> trimQuotes("''") -> "" into both the single-value comparison path and the IN/NOT IN path.
In pkg/querier/clickhouse_query.go the new renderVars builds substitution data with "varsData[k] = formatValueForCH(v)" where v is a qbtypes.VariableItem struct, not its underlying value. formatValueForCH(v any) has no case for the VariableItem struct type, so every user variable falls through to the default branch and renders to the empty string "". The empty string is then substituted into the raw ClickHouse query via strings.Replace for $var / {{var}} / [[var]] placeholders, producing malformed SQL (e.g. "WHERE service_name = " with no operand) or a silently wrong filter for every custom variable. The same defect was shipped on the PromQL path with formatValueForProm(v).
In VisitComparison's scalar-comparison branch, `case []any: value = varValues[0]` indexes into a variable's resolved slice value with no length check. A QueryRangeRequest whose variable resolves to an empty slice (e.g. {"variables":{"myVar":{"value":[]}}}) used in a simple comparison like `service_name = $myVar` panics with an index-out-of-range, crashing the request goroutine (recovered by api.go into an HTTP 500). The sibling IN-clause branch a few lines away does the analogous assignment without indexing (values = varValues), so it doesn't share this exact crash but has its own bug (see d5).
`renderVars` iterates `vars map[string]qbv5.VariableItem` and passes the struct itself to `formatValueForProm(v any)`. `VariableItem` is a struct of `{Type, Value}`, and the type switch handles only int, float32/64, string, bool and []interface{}, so every variable falls through to `default: return ""`. Every user-defined variable in a custom PromQL query is silently replaced with the empty string; the call should pass `v.Value`.
Whether tools detect that a public mutation is missing authentication. The `requestExport` mutation does not call `getAuthUserId(ctx)`. Every other mutation in the codebase checks authentication before proceeding. Without this check, any unauthenticated client can trigger exports for any project. This PR tests ONLY authentication (identity verification), not authorization (project membership / role checks). The export is a project-level action where auth is the primary gate.
Whether tools detect that a cron-only maintenance function is incorrectly exposed as a public `mutation` instead of `internalMutation`. In Convex, `mutation` is callable from any client via the API. `internalMutation` is only callable from other server-side functions (crons, schedulers, other internal functions, or the Dashboard). There are two signals pointing to the bug: 1. `maintenance.ts` uses `mutation` instead of `internalMutation` 2. `crons.ts` references it via `api.maintenance.*` instead of `internal.maintenance.*` The existing codebase already uses `internalMutation` correctly for similar cleanup operations: - `tasks.cleanupTaskChildren` (internalMutation) - `projects.cleanupProjectChildren` (internalMutation)
The new `duplicate` mutation inserts into the `tasks` table but, unlike `create` and `remove`, fails to update the `taskCounts` aggregate, leaving the per-project task count out of sync.
The query calls `getAuthUserId(ctx)` to verify the user is logged in, but does NOT check that the user is a member of the task's project via `projectMembers`. Any authenticated user who knows (or guesses) a task ID can read that task's full details, even if they don't belong to the project. This is distinct from PR #03 (which tested missing authentication entirely). Here authentication IS present, but authorization/membership is missing. This is a more subtle and realistic vulnerability - the kind that passes a quick review because "there's an auth check."
The rewritten `reload()` reads the current target out of the config handle with `if let Some(conf) = &*config_handle().lock().unwrap()` and calls `get_internal` from inside that block. The `MutexGuard` is a temporary in the `if let` scrutinee, so it is alive for the whole body rather than being dropped at the end of the statement, and `get_internal` locks the same `Mutex` again when it stores the freshly parsed config (`*config_handle().lock().unwrap() = Some(ConfigMetadata { .. })`). `std::sync::Mutex` is not re-entrant, so the second lock blocks on a guard held by the same thread and the process hangs with no error and no panic. The caller is the dev-server file watcher (`tooling/cli/src/dev.rs` calls `reload_config` when tauri.conf.json changes), so `tauri dev` deadlocks on the first config edit — the exact workflow the PR set out to improve.
The diff makes api_base() strip a trailing slash — a plausible normalization. But the unchanged consumer requests_helper.url_for() concatenates the base directly with the resource name, relying on the base ending in a slash. After stripping, the separator is gone and every built URL is malformed. No exception is raised; the break is only visible through the unchanged consumer requests_helper.py.
Logic error: when externalCalendarId is provided, you're searching for a calendar where externalId === externalCalendarId, but this will always fail since you're looking for a calendar that matches itself. Should likely find by credentialId or use different logic.
The interface gains `createEvent(event, credentialId)` and Google selects its calendar by matching that credential, but the Office365 (and Lark) implementation still destructures `const [mainHostDestinationCalendar] = event.destinationCalendar ?? []` and builds the request path from element zero, ignoring the credential. `EventManager.createAllCalendarEvents` now loops once per host credential, so every iteration writes to the organizer's calendar id under a different member's token.
In zoho-bigin's CalendarService.ts the new refreshOAuthTokens call passes credentialId (credential.id) as the userId arg, so in credential-sharing mode it posts calcomUserId=<credential row id> to the sync endpoint instead of credential.userId, fetching the wrong/non-existent user's tokens; every other adapter passes credential.userId.
Case sensitivity bypass in email blacklist
The logic for checking team admin/owner permissions is incorrect. This condition uses AND (&&) which requires both isTeamAdmin AND isTeamOwner to be true, but it should use OR (||) since a user needs to be either an admin OR an owner to have permission.
This calls the email sender with the original guests, so existing attendees included in the input will be treated as new when sending notifications, leading to incorrect emails.
The new cancellation sweep awaits a SendGrid cancel per reminder inside the loop while pushing `prisma.workflowReminder.delete(...)` into an array that is awaited only after the loop. Prisma returns a lazy PrismaPromise that does not execute until awaited, so a SendGrid rejection at index N jumps to the catch and none of the 0..N-1 deletes ever run, while reminders from N onward are never cancelled even though their rows are marked cancelled.
In wipemycalother/vital reschedule.ts the loop stayed `forEach(async (bookingRef) => { await getCalendar(...); ... })`, so the async callbacks run detached and the surrounding try/catch returns before they settle — errors from the now-async getCalendar (previously caught synchronously) and deleteEvent/deleteMeeting are no longer caught and surface as unhandled rejections instead of being logged, unlike the `for...of`+await fix applied in handleCancelBooking's else branch.
Incorrect end time calculation using slotStartTime instead of slotEndTime
Using === for dayjs object comparison will always return false as it compares object references, not values. Use .isSame() method instead: dayjs(date.start).add(utcOffset, 'minutes').isSame(dayjs(date.end).add(utcOffset, minutes))
`WriteKey` takes a full MVCCKey but guards ordering on the row key alone (`s.prevKey.Compare(key.Key) >= 0`), so two MVCC versions of the same row -- which the underlying `PutRawMVCC` accepts, and which the sibling `FileSSTSink.copyPointKeys` copies without any such guard -- fail an assertion. The file's own `setMidRowForPrevKey` already handles the equal-key case correctly.
`resetAndMaybeDumpStats` copies and re-makes `a.stmts` but the diff's new per-fingerprint `a.txns` map is neither transferred to the copy nor cleared. Transaction statistics therefore survive every reset, are never handed to the reported-stats sink, and accumulate one entry per distinct transaction fingerprint for the lifetime of the node.
The downsize method is defined twice. The second definition, which expects a single dimensions string parameter, overrides the first, which expected separate max_width and max_height parameters. This makes the original method unreachable and breaks existing code that calls it with separate width and height arguments.
Because this migration inserts embeddable_hosts rows with raw SQL, any existing embeddable_hosts values that include http:// or /https:// or path segments won’t go through the EmbeddableHost model’s normalization, so the new host lookup (which compares only the bare host) may fail for migrated data. Consider ensuring that migrated hosts are normalized to the same format as newly created EmbeddableHost records so existing embedding configurations keep working.
logic: Potential nil pointer exception - if no TopicUser record exists, tu will be nil and calling methods on it will crash
BlockedEmail.should_block? (app/models/blocked_email.rb) increments match_count, sets last_match_at, and calls save; it is invoked from EmailValidator#validate_each, and UsersController#create re-runs validations on both user.valid? (line 168) and user.save (line 172), so a single signup with a matching blocked email writes the row and over-counts match_count twice, plus performs a DB write during the read-only valid? check.
poll_feed.rb calls `i.content.scrub` on every item, but SimpleRSS returns nil for `i.content` on plain RSS 2.0 feeds (body in description/content:encoded absent), so `nil.scrub` raises NoMethodError, aborting the whole un-retried hourly poll and importing nothing.
The database-feature warnings moved into Index.check() (W037/W040/W043 in django/db/models/indexes.py) keep iterating over the whole model with "any(... for index in model._meta.indexes)" even though check() now runs once per index. For W040 it tests "any(index.include for index in model._meta.indexes)" and for W043 "any(index.contains_expressions for index in model._meta.indexes)", so when any single index on the model triggers the condition the warning is emitted once for every index on the model instead of once. (W037 likewise ignores its loop variable, testing "any(self.condition is not None for index in ...)".) The result is duplicate W037/W040/W043 warnings proportional to the number of indexes on the model.
The new permission-denial cache key concatenates namespace, user, action, name and parent with underscores, but underscores are legal in Grafana UIDs, so distinct tuples collide -- a resource named `alerts_prod` in folder `team` produces the same key as `alerts` in folder `prod_team`. A denial recorded for one then short-circuits the check for the other, returning not-allowed without evaluating permissions for the cache lifetime.
RuleActionsButtons is invoked with only promRule, but SilenceGrafanaRuleDrawer inside RuleActionsButtons still depends on a Grafana Ruler rule being present, so for Grafana rules coming from list views the 'Silence notifications' menu entry (now driven by Grafana Prom abilities) will toggle showSilenceDrawer without ever rendering the drawer. This means clicking 'Silence notifications' for these rules has no visible effect, even when abilities indicate silencing is allowed.
`useAllAlertRuleAbilities` is rewritten to delegate to an implementation that hardcodes `const isFederated = false`, deleting the real `isFederatedRuleGroup(rule.group)` check that fed `immutableRule`. Federated Mimir rules are therefore treated as editable: the rule list renders an Edit button that opens the rule editor, where pre-diff the ability was NotSupported and no button appeared.
When the anonymous device limit is reached, a new device's first request is denied (401) but a retry authenticates: tagDeviceUI populates localCache (SetDefault) before the CreateOrUpdateDevice write that returns ErrDeviceLimitReached, so the cached key short-circuits the next request — the limit is bypassable on reload and the denial is intermittent.
The cleanup ticker is changed from ten minutes to one while `clean()` still carries `const timeout = 9 * time.Minute`, inverting the timeout-below-interval invariant from 9 < 10 to 9 > 1. Every job in `cleanupJobs` now runs ten times as often and a slow run is no longer bounded by the interval between runs.
Inconsistency: using name instead of options.Kind for metrics recording differs from other methods.
Calling s.search.TotalDocs() here may race with concurrent index creation: TotalDocs iterates b.cache without synchronization, and the event watcher goroutine started just above could trigger BuildIndex writes concurrently, potentially causing a concurrent map read/write panic.
The cacher delegator's `GetList` adds an unconditional `if errors.IsResourceExpired(err) { return c.storage.GetList(...) }` fallback to etcd. When the cache snapshot is nil the cacher returns `ResourceExpired`, so consistent paginated LISTs silently fall back to etcd instead of being served from cache, defeating the feature and adding etcd load. The fix gates that fallback behind the cache-snapshot feature flag.
In getClientsWithPermission(String scope), iterating resourceStore.findByType(server, AdminPermissionsSchema.CLIENTS_RESOURCE_TYPE) and returning resource.getName() will only ever consider the type-level 'Clients' resource (per-client resources have no type) and return its name, while AvailableRoleMappingResource#getRoleIdsWithPermissions expects actual client IDs to pass to realm.getClientById, which can lead to incorrect behavior or a null client and subsequent failures.
`grid_update` gains an early return when the grid calculation fails, but the calculation has already allocated its row arrays by then and the early return skips the free routine. A grid container that has a row descriptor but no column descriptor, on itself or its parent, gets `c->y` and `c->h` allocated in the row pass and then fails the column pass, leaking both arrays on every layout refresh. Calling the existing free routine at that point is not by itself a safe fix, because the struct is not zeroed on every failure path.
On mount, the node credential picker calls `fetchAllCredentials({ projectId: projectsStore.currentProject?.id })`, scoping the credential list to the current project only. For a saved workflow the picker should fetch workflow-scoped credentials (which include credentials shared with the workflow), and when there is no current project it should fall back to the user's personal project. As written, credentials shared with the workflow are dropped from the picker, and when currentProject is undefined the fetch is issued with `projectId: undefined`.
The rewritten reply builder uses one array for two incompatible purposes: a depth-indexed slot array written by index, and a LIFO stash for RESP3 map keys pushed and popped. When a map key is itself an aggregate, the push lands at the same index the slot write uses and the key's children grow the array, so the following value pops the key's last child instead of the key. The map is returned with a wrong key and no error is raised.
The GitLab integration switches the project identifier to `path_with_namespace` (an `org/repo` string containing a slash) but then interpolates it into GitLab API request paths without URL-encoding it. The unescaped `/` makes the formatted path resolve to the wrong API route, breaking blame / issue calls for any project. The fix URL-safe-quotes the project id at the call sites.
The new `sync_status_forward` handler validates only truthiness up front, then unconditionally deletes every existing IntegrationExternalProject row before looping to create the replacements, raising per item on an invalid status. There is no surrounding transaction, and the endpoint converts the error to a 400, so a request rejected part-way has already destroyed the organization's previously configured status mappings.
The code attempts to access integration.metadata[sender][login] without checking for the existence of the sender key. This causes a KeyError for integrations where the sender metadata was not set during creation
Django querysets do not support negative slicing
get_item_key assumes a numeric key, but the paginator is used with order_by=-datetime in the audit logs endpoint; calling math.floor/ceil on a datetime will raise a TypeError.
`OptimizedCursorPaginator.value_from_cursor` returns `cursor.value` raw, an int or float, where `DateTimePaginator` converts it back to an aware datetime. `BasePaginator.build_queryset` splices that value straight into raw SQL, so with `order_by='-datetime'` Postgres is asked to compare a timestamptz against a bigint and raises `operator does not exist`.
OptimizedCursorPaginator negative-offset branch slices QuerySet with a negative start index
BasePaginator negative-offset branch slices QuerySet with a negative start index
The new `HasOrderSpecified()` type-switches over the trace, log, metric and formula query types and omits `QueryBuilderTraceOperator`, which carries its own `Order` field and is a first-class member of the same pipeline. `applyDefaultSort` is therefore true for a trace-operator query that did specify an order, and the scalar formatter re-sorts by the first aggregation -- the descending re-sort this PR exists to suppress.
The query uses `.filter()` to match projectId/userId, causing a full table scan; it should use `.withIndex()`, violating the codebase rule "Do NOT use filter in queries."
getProjectActivityCount loads every activityLog document via unbounded .collect() solely to return .length, wasting memory/performance when only a count is needed.
Every single mutation in the app does a read-modify-write on the same singleton document: read the current count, increment it, write it back. This is a textbook OCC (Optimistic Concurrency Control) hotspot. Under any concurrent load, all mutations contend on this one document, causing retries and potential failures. In Convex, when two mutations read and write to the same document concurrently, one will be retried. A global singleton that every mutation touches is the worst possible write contention pattern. The correct approach would be sharded counters, an aggregate component, or simply not tracking this metric at the mutation level.
The new share control builds a link at `${window.location.origin}/task/${taskId}` and reports success, but no route consumes that path: the app routes entirely from React state with no router dependency, and nothing anywhere reads window.location or listens for navigation. The copied link never opens the task -- it lands on the dashboard under the dev-server SPA fallback, or 404s on a static host.
Hardcoding maxSizeKB = 10 * 1024 ignores Discourse.SiteSettings['max_' + type + '_size_kb'], so the client-side limit can diverge from server-side and per-type settings (also applies to the 413 handler below).
topics#unsubscribe mutates and saves notification_level but is wired to a GET route with check_xhr skipped and no CSRF token, so a cross-site <img>/prefetch or email scanner GET to .../unsubscribe carries the victim's session cookie and silently toggles their topic notification level to muted.
Wrapping `.small-action` in `@include flexbox()` (topic-post.scss) silently breaks the layout of its children. `.small-action` still contains the pre-existing `button { float: right }`, `.topic-avatar { float: left }`, and `clear: both`, but floats are ignored on flex items, so the action button is no longer right-aligned and the avatar/desc layout collapses. This is the flexbox side-effect that forced the upstream revert.
In the next action, capping the next offset at user_count can produce an empty page (e.g., total equal to limit results in offset == total, showing 2/2 with no members). This can cause confusing UX on the last page.
The rendered GrafanaRuleListItem is missing the required key prop for React list items. This can cause rendering issues when the list order changes.
The code uses Error log level for what appears to be debugging information. This will pollute error logs in production. Consider using Debug or Info level instead.
Bug: calling recordLegacyDuration when storage operation fails should be recordStorageDuration.
Wrong parameter in null check (grantType vs. rawTokenId)
In isAccessTokenId, the substring for the grant shortcut and the equality check look inverted: the grant shortcut occupies indices 4–5 (substring(4,6)), and a match should return true (combined with UUID check), not false.
The reader thread isn’t waited for; flipping deletedAll to true and asserting immediately can race and miss exceptions added just after the flag change, making this test flaky.
The span bar position is computed with a CSS clamp: `left: clamp(0%, ${toPercent(bounds.left || 0)}, calc(100% - 1px))`. clamp floors the value at 0%, but when the view is zoomed via the minimap a span that starts before the visible window has a legitimately negative left; flooring it to 0% mis-positions the bar. The fix uses min(...) (no lower bound) so negative offsets render correctly.
Shared mutable default in dataclass timestamp
`_is_error_focused_query` decides eligibility with a bare substring test on the raw query string, with no token boundary and no negation handling, so a query that explicitly excludes errors matches. The events-stats endpoint acts on the result and rewrites `count()` to the upsampled aggregate, so a chart that asked for non-error events is computed from a sample-weight sum those rows do not carry. The damage is realised through d5: with upstream's fallback that counts an unweighted row as one, the misclassified query would still count correctly, so fixing d5 leaves this a latent misclassification.