Skip to content

fix: document DefaultExpiredAt and remove dead example code#204

Merged
chrisli30 merged 1 commit into
mainfrom
fix/cleanup-expired-at-and-example-helpers
Mar 27, 2026
Merged

fix: document DefaultExpiredAt and remove dead example code#204
chrisli30 merged 1 commit into
mainfrom
fix/cleanup-expired-at-and-example-helpers

Conversation

@chrisli30

Copy link
Copy Markdown
Member

Summary

  • DefaultExpiredAt: Changed from -1 to 0 with JSDoc explaining the semantic. The backend (executor.go:554) only enforces expiration when expiredAt > 0, so any value <= 0 means "never expire". 0 is cleaner as it matches the protobuf zero value.
  • Example cleanup: Removed commented-out createInputData/extractInputData/hasInputData helper functions that were never implemented. The plain object approach below them works fine.

Closes #199, closes #200

Test plan

  • yarn build succeeds
  • No behavior change — 0 and -1 are both treated as "never expire" by the backend

- Change DefaultExpiredAt from -1 to 0 with JSDoc explaining that any
  value <= 0 means "never expire" (backend only checks expiredAt > 0)
- Remove commented-out createInputData/extractInputData/hasInputData
  helper functions that were never implemented

Closes #199, closes #200
@chrisli30 chrisli30 merged commit 908eac2 into main Mar 27, 2026
7 checks passed
@chrisli30 chrisli30 deleted the fix/cleanup-expired-at-and-example-helpers branch March 27, 2026 22:31
@claude

claude Bot commented Mar 27, 2026

Copy link
Copy Markdown

PR Review

This is a small, focused cleanup PR. Both changes are appropriate and overall quality is good.

DefaultExpiredAt value change (workflow.ts:13)

The JSDoc is clear and well-grounded in backend behavior. Switching to 0 aligns with protobuf zero-value semantics — good call.

One minor nit: the import ordering. After the change, line 13 is the export const and line 14 is an import statement:

export const DefaultExpiredAt = 0;
import { WorkflowStatus, WorkflowProps, InputVariables } from '@avaprotocol/types';

Imports are hoisted so this works, but it's non-standard and easy to miss. Since the line is already being touched in this PR, worth moving that import up to join the others at lines 1-7.

Also: DefaultExpiredAt is exported from workflow.ts but does not appear to be re-exported from the package's main index.ts. If it's intended for SDK consumers, it should be in the public API. If it's internal, a short comment to that effect would help.

Dead code removal (examples/example.ts)

Clean and correct. The removed block was a commented-out TODO referencing functions (createInputData, extractInputData, hasInputData) that were never implemented. Removing it entirely is the right call. The emoji annotation cleanup on the trigger input line is also good hygiene.

Summary

  • DefaultExpiredAt value + JSDoc: good change, well documented
  • Import ordering: minor nit, easy fix while the line is in scope
  • DefaultExpiredAt public export: confirm intent (SDK consumer vs internal)
  • Dead code removal: clean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove or implement commented-out helper functions in example code Document DefaultExpiredAt = -1 semantic meaning

2 participants