Skip to content

fix: Preserve explicit zero timedelta values in discovery manifests - #230

Merged
slinkydeveloper merged 3 commits into
restatedev:mainfrom
hnicke:fix-zero-retention
Sep 2, 2026
Merged

fix: Preserve explicit zero timedelta values in discovery manifests#230
slinkydeveloper merged 3 commits into
restatedev:mainfrom
hnicke:fix-zero-retention

Conversation

@hnicke

@hnicke hnicke commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Passing explicit timedelta(seconds=0) timedelta values for inactivity timeout, abort timeout, journal retention and idempotency retention was silently dropped - instead, the global defaults were used.
Now, settings the retention times to 0s properly disables the rentention.

Fixes #172

@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@hnicke

hnicke commented Aug 29, 2026

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@hnicke

hnicke commented Aug 29, 2026

Copy link
Copy Markdown
Contributor Author

recheck

Setting retention times to `timedelta(seconds=0)` was silently dropped; instead, the global defaults were used.
Now, settings the retention times to 0s properly disables the rentention.
@hnicke
hnicke force-pushed the fix-zero-retention branch from e4b6aa6 to 46016d1 Compare August 29, 2026 08:09
@hnicke hnicke changed the title fix: Preserve explicit zero retention values in discovery manifests fix: Preserve explicit zero timedelta values in discovery manifests Aug 29, 2026
@slinkydeveloper

Copy link
Copy Markdown
Contributor

Nice catch, the timedelta(0) being falsy trap is easy to miss and this is the right fix.

One thing though: workflowCompletionRetention a few lines down still uses the old if handler.workflow_retention check, so a workflow_retention=timedelta(0) would still get dropped. Same bug, just missed it in this pass. Mind switching that one to is not None too while you're here, so all the retention/timeout fields behave the same?

Also would be great to add a small test asserting timedelta(0) ends up as 0 (and not None) in the computed manifest, so this doesn't regress.

@slinkydeveloper
slinkydeveloper requested review from slinkydeveloper and removed request for igalshilman September 2, 2026 09:41
@hnicke

hnicke commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

The changeset now also covers the if handler.workflow_retention check and adds regression tests.

@slinkydeveloper
slinkydeveloper merged commit cd9c9d6 into restatedev:main Sep 2, 2026
7 checks passed
@slinkydeveloper

Copy link
Copy Markdown
Contributor

Thank you for the contribution!

@github-actions github-actions Bot locked and limited conversation to collaborators Sep 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

timedelta(seconds=0) silently ignored for inactivity_timeout and other duration options

2 participants