Repository navigation
Conversation
A raising after_commit callback propagated after the durable commit, skipped later callbacks and made the committed write look failed. Each failure is now logged with its traceback on the fastapi_startkit.masoniteorm logger and passed to an optional reporter set with DB.report_after_commit_failures_using. See ADR 057. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Drop the reporter hook and the log-and-continue policy. Every queued callback still runs; the first exception is re-raised unchanged once they finish, and later failures are logged. See ADR 057. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lback-failures # Conflicts: # docs/adr/AGENTS.md
Contributor
Author
|
Closing: stopping at the first failing after-commit callback is the intended behaviour and matches Laravel. |
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.
Summary
after_commitcallback stopped the loop, so the remaining callbacks were skipped even though the write was already committed.commit_transaction,Transaction.commit()orasync with connection.transaction().fastapi_startkit.masoniteormlogger, so they aren't lost.BaseExceptions such asCancelledErrorstill propagate immediately.ExceptionGroupwas rejected.Docs follow-up
The Database Transactions section of
docs/database/index.mdin the docs repo says errors propagate after a durable commit. That is still true. It should add that the remaining callbacks still run and only the first error is raised.Test plan
tests/masoniteorm/connections/test_after_commit.py:pool_size=1engine;uv run pytest --ignore=tests/masoniteorm/postgres --cov: 3722 passed, coverage 92.75%.🤖 Generated with Claude Code