fix(events): core.lease keeps a module's retry: false on read/apply refusals #236
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/lease-retry-206"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #206.
What
core.lease'sperformrebuilt itsreadandapplyfailure returns as{ ok: false, error }. The module'sretrywas dropped, so the dispatcher's default (retry !== false,events/dispatch.js:184) retried permanent refusals three times. Examples are module-rust'sevents-disabledand an unresolved target. That made MODULE_API §1.1'sretry: falseopt-out unreachable for leases.Both returns now pass
retry: falsethrough when the module said so, and leaveretryundefined otherwise, so the default is unchanged. Error text and the release of the reservation after a failed apply are unchanged.Tests
server/test/eventModuleContract.test.js, three new cases:retry: false→ terminal; no reservation is made.retry: false→ terminal; the reservation is still released (markReverted).retry: false→ still retried.Results:
node --test test/eventModuleContract.test.js→ 32/32 pass.npm testlocally: 2283 pass, 2 fail.routeManifest.test.jssync checks, caused by the locally installedmodules/uoandmodules/rustadding routes. WithMODULES_DIRpointed at an empty directory they pass 4/4.No API, route or schema change, so no Swagger or BACKEND_DESIGN edit. The docs follow-up (the PLAN §27.6 note) goes in a separate docs PR.
🤖 Generated with Claude Code
https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
core.lease rebuilt both failure envelopes as { ok: false, error }, so a module's retry: false was dropped and the dispatcher retried a permanent refusal (e.g. module-rust's events-disabled) three times. Both returns now pass retry: false through and leave retry undefined otherwise, so the dispatcher's default still applies. Three tests in eventModuleContract cover read, apply (reservation still released) and the default. Closes #206 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY