-
Notifications
You must be signed in to change notification settings - Fork 439
Open
Description
Problem
The rust/periodic_tasks/timer example uses ic-cdk-timers = "0.6" and the old closure-based API. The ic-cdk-timers v1.0.0 release (2025-11-13) introduced breaking changes to function signatures.
What needs updating
Dependencies (timer/Cargo.toml)
ic-cdk0.12→0.19ic-cdk-macros0.8→ currentic-cdk-timers0.6→1.0
Code (timer/src/lib.rs)
set_timer_interval signature changed — now takes FnMut() -> impl Future instead of FnOnce():
// Old (line 71):
let timer_id = ic_cdk_timers::set_timer_interval(secs, periodic_task);
// New:
let timer_id = ic_cdk_timers::set_timer_interval(secs, || async { periodic_task() });ic_cdk::spawn() comment is obsolete (lines 75-77) — set_timer now takes futures directly, no spawn wrapper needed.
dfx references in doc comments (lines 53, 65, 82, 96) — dfx is deprecated, should use icp CLI.
Heartbeat example (heartbeat/Cargo.toml)
- Same outdated
ic-cdk/ic-cdk-macrosversions
Project-level
dfx.jsonat project root — should be migrated toicp.yaml
References
- ic-cdk-timers v1.0.0 changelog
- Found while updating developer-docs PR #9 (timers guide)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels