Repository navigation
feat(schedule): pass the rejected row to the error handler - #296
Merged
Merged
Conversation
An onError handler was given the throwable and nothing else, so a failure it could name -- the row `make` refused -- arrived without one. In Appwrite Cloud that is a Sentry event reading "Collection not found", region and nothing more, for one of thousands of schedules. The row is already in scope at the catch site. Passing it on lets a handler attach the schedule's identity to whatever it reports. Handlers that declare only the error keep working, since PHP ignores the extra argument.
ChiragAgg5k
requested review from
Meldiron,
abnegate,
eldadfux and
loks0n
as code owners
September 17, 2026 15:32
Benchmark resultsschedule — dispatch and reconcile at scale (4 cores, 10000 schedules: 30% cron / 70% interval, 30 ticks)
115680 occurrences dispatched, 3856 per tick average. Selecting one minute of coverage spends 0.082% of the 60s tick interval. Shared CI runners — treat absolute numbers as rough, compare modes within a run. Commit d96a9af. |
loks0n
approved these changes
Sep 17, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
onErrorreceived the throwable and nothing else. It now also receives theRowthatmake()refused, so a handler can say which schedule failed.Backward compatible: PHP ignores extra positional arguments to userland closures, so a handler declaring only
\Throwable $errorkeeps working.ReconcileTeststill has one of those and still passes.$rowis null for a failure no single row owns (a snapshot that throws).Why
On Appwrite Cloud these arrive as Sentry events reading
Collection not found, withregion = fraand nothing else — for one of several thousand schedules. Identifying the row meant writing a task to re-derive it.The identity is already in scope at the catch site; it just wasn't passed on. With this, a handler can do what the enqueue path in the same file already does:
Tests
One case: the handler is given the row
make()rejected, asserted on itsidanddata. Seen red — it errors without thesrc/change.bin/monorepo check schedule,bin/monorepo test schedule(96 unit + 9 e2e) andbin/monorepo validatepass.Note
Touches the same
catchblock as #295, so whichever lands second needs a one-line rebase.