feat: an error in an after hook returns the default value - #428
feat: an error in an after hook returns the default value#428kripa-sindhu-007 wants to merge 1 commit into
Conversation
Signed-off-by: Kripa Sindhu <mail@kripasindhu.dev>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe Hooks specification adds Requirement 4.4.8. Errors in ChangesHooks specification
Estimated code review effort: 1 (Trivial) | ~3 minutes Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The Hooks specification now defines that after-hook errors return the default value, consistently in both published representations. No merge-blocking risk remains. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
Comment |
|
The
Neither file is touched here. This branch changes only Everything else is green, including Happy to send a separate PR that swaps them for |
If you can find some other links that work, that would be great, and we can rebase on that. |
|
@toddbaert #429 is up for the links.
The README badge now points at
I will rebase this one on main once that lands. |
This PR
afterhook returns the default valueRelated Issues
Fixes #427
Notes
I added a new point rather than widening 4.4.7, but that is the part worth deciding rather than assuming.
Widening 4.4.7 to say "before or after" would be the smaller diff, and it would match 4.4.5 and 4.4.6, which already cover both stages in one line. What put me off it is that it changes an existing requirement's meaning in place. SDKs name their conformance tests after the requirement, so every existing 4.4.7 test would silently stop covering the whole requirement, with nothing to tell the maintainers. A new
requirement_4_4_8gives each SDK an id to implement and track against.It also gives the rationale somewhere to live. Before hooks are abnormal execution because they can mutate the evaluation context; after hooks are abnormal execution because they can reject a resolution they consider invalid. Those are different arguments and they read poorly merged into one sentence.
The third paragraph is for your point about
errorandfinally. It states that their failures are contained by 4.4.4 and 4.4.3 and do not change the value returned to the application author, so the new requirement does not read as widening those too.Happy to switch to widening 4.4.7 instead if the TSC would rather not add a number.
For cross-SDK context, on go-sdk#566 I checked how this is implemented today: JS server and web, Java and Python all treat an after-hook error as abnormal and return the default with reason
ERRORand codeGENERAL. Rust builds the error details and then discards them, returning the originalOk, which looks unintentional. Go is the one this came from.Follow-up Tasks
requirement_4_4_8conformance test. go-sdk already behaves this way, so for Go it is a test rather than a behaviour change.Okafter building the error details. If this is agreed, that is worth its own issue againstopen-feature/rust-sdk. I can file it with the details.How to test
4.4.7 stays byte for byte unchanged and requirement_4_4_8 is appended before requirement_4_5_1.