[pull] main from danny-avila:main - #582
Merged
Merged
Conversation
* 🎨 ci: Gate Frontend Jest on Codegraph Selection (Stage 1.5) * ci: a malformed FILES decision runs FULL, never skips (Codex) * ci: dev-push runs never cancel each other (Codex P2) * ci: workflow-file push baseline, cancellable gated jobs, pull-requests read (Codex r4) * ci: selected paths must live under their workspace, else FULL (Codex r5) * ci: drop stale selected paths, run FULL when none exist (Codex r6)
…oll (#15144) * ⚡ perf: Use Plain JSON for the In-Memory Cache Store Every read from the in-memory Keyv fallback paid @keyv/serialize's Buffer-aware reviver: 0.33ms for a 12KB config-shaped value against 0.038ms for a plain JSON round trip, on every config, role, and model lookup a request makes. An instrumented sweep of the e2e suite — the serializer wrapped to flag any value carrying the Buffer marker, armed in all seven server and fixture processes — found no namespace ever caching a Buffer. Plain JSON keeps the semantics readers already rely on: values are copies, never references into the store, and dates still come back as ISO strings. A Buffer would now round-trip as its JSON form instead of reviving; the new spec pins that as the documented contract. The Redis and file-backed stores are untouched. * ⚡ perf: Back Off the Trigger Delivery Poll While the Queue Is Idle The delivery engine issued a claim findOneAndUpdate every second per replica whether or not any trigger existed — ~86k no-match queries a day on an idle deployment. The poll now doubles its interval after each empty claim pass, capped at maxIdleTickMs (default 15s, floored at tickMs), so an idle replica settles at four queries a minute's worth of chatter down to one per fifteen seconds. Nothing that has work waits: enqueues and finished deliveries already call wake(), which now also snaps the streak and the poll timer back to the base cadence before claiming. The only latency this can add is cross-replica pickup of a trigger enqueued elsewhere while this replica is fully idle — bounded by the cap. The next timer delay is computed after each claim settles, so the backoff is never a step behind the queue's state. * 🎯 fix: Never Let Anything but a Confirmed-Empty Queue Advance the Idle Backoff Two review findings, both real. A failed claim pass proves nothing about the queue, yet it advanced the idle streak exactly like a confirmed-empty one — repeated transient database failures would have stretched recovery polls toward the ceiling and left due deliveries waiting after recovery. Failures now reset the streak, restoring the pre-backoff status quo of one-second retries through an outage and immediate catch-up after it. And service.requeue(), which revives a dead letter straight in Mongo, never woke the engine, so a revived delivery could wait out a full idle interval that the old fixed poll bounded to a second. A successful requeue now wakes the engine exactly as the enqueue path does; a requeue that revived nothing wakes nothing. * 🎯 fix: Never Sleep Past a Known Eligibility Time A delivery that exists but is not yet eligible reads as an empty queue to the claim pass, so a retry or defer scheduled a few seconds out could wait out the full idle interval that the old one-second poll bounded tightly. The engine computes every one of those future availableAt times itself — retries, defers, and the ordering recheck — so it now records the earliest of them and the idle timer never sleeps past it; the marker clears once reached. The service routes future-dated enqueues and requeues through the same noteEligibleAt seam and wakes immediately for due ones, as before. Deliveries delayed by another replica remain bounded by maxIdleTickMs, the same class of tradeoff as cross-replica enqueue pickup. * 🎯 fix: Track Every Eligibility Deadline, Not Just the Earliest A single next-eligible slot discarded later deadlines: with retries due at t1 and t2 > t1, reaching t1 cleared the only timestamp and the t2 delivery degraded back to idle-poll pickup, up to maxIdleTickMs late. The engine now keeps a sorted, deduplicated, bounded list of the future availableAt times it has seen, prunes entries as they come due, and re-arms the timer whenever a new earliest arrives — including while the timer is already sleeping toward the idle cap, which the previous insert-at-head check missed for an empty list. On overflow the latest deadline is dropped and that delivery falls back to the capped idle poll, the same bound that covers deliveries delayed by other replicas.
The two attribute-flip tests mutated inside act() and then raced a 4 second waitFor against MutationObserver delivery, so they failed once the client workspace gained enough suites for a worker to stall past that budget. Wait on actual observer delivery instead. The hook registers its observer on mount, so it is ahead of the test's in delivery order and has already reacted by the time the promise resolves. The new helper filters on data-active-item because React writes data-active onto the same element when it re-renders, and an unfiltered observer would resolve on that write instead. This removes the last wall-clock dependence in the file, so the 20 second jest timeout is no longer needed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )