Commit e3d9394
chore: replace unmaintained backoff with backon (release 0.49.1) (#738)
* chore: replace unmaintained backoff with backon
`backoff` is flagged as unmaintained. Replace it with `backon` for the
`request_status` polling backoff in ic-agent.
- Wrap `backon::ExponentialBackoff` in a small `RetryPolicy` that tracks
wall-clock elapsed time (via `web-time`, so it works on wasm32) and
bounds polling by `max_polling_time`. Delay schedule is unchanged:
500ms initial, x1.4 growth capped at 1s, jittered.
- `backoff/wasm-bindgen` previously enabled `getrandom` 0.2's `js`
backend for the transitive crypto crates on wasm. Restore that
explicitly via a renamed `getrandom_0_2` dependency gated on
ic-agent's `wasm-bindgen` feature.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: release 0.49.1 — replace unmaintained backoff with backon
Bump all workspace crates 0.49.0 -> 0.49.1. This is a patch release: the
backoff -> backon swap is an internal dependency change with no public API
or behavior change.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: use backon ExponentialBackoff directly, drop RetryPolicy
The RetryPolicy wrapper was a 1:1 re-implementation of the old
`backoff::Backoff` trait (next_backoff / reset / get_elapsed_time). The
polling schedule is an internal detail, so lean on backon's building
blocks instead:
- Drive `backon::ExponentialBackoff` (an Iterator<Item = Duration>)
directly in the poll loops.
- Bound the polling budget with backon's `with_total_delay(max_polling_time)`
so the iterator yields None once the cumulative sleep is spent — no
manual elapsed-time bookkeeping.
- Track a small `slept` accumulator only for the existing 5-minute
"Unknown => ingress message lost" guard.
This also drops the `web-time` dependency added earlier (it was only
needed for the wrapper's wall-clock Instant). `max_polling_time` now
bounds cumulative backoff sleep rather than wall-clock elapsed; in
practice they differ only by per-poll request latency.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* review: clarify slept-based timeout comment; align getrandom_0_2 enablement
Address Copilot review feedback on PR #738:
- Clarify the `Unknown => ingress message lost` comments in both poll
loops: the 5-minute threshold is now cumulative backoff sleep
(`slept`), not wall-clock, so it excludes per-poll request latency.
- Enable `getrandom_0_2` via `dep:getrandom_0_2` + `features = ["js"]`
on the dependency, mirroring the sibling `getrandom` (0.4) entry
exactly. This is unambiguous and suppresses the implicit
`getrandom_0_2` feature that `getrandom_0_2/js` would otherwise leak
on ic-agent's public feature set.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent e9e76f7 commit e3d9394
5 files changed
Lines changed: 82 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
60 | 65 | | |
61 | 66 | | |
62 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | | - | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
92 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
93 | 102 | | |
94 | 103 | | |
95 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
| 56 | + | |
58 | 57 | | |
59 | 58 | | |
60 | 59 | | |
| |||
838 | 837 | | |
839 | 838 | | |
840 | 839 | | |
841 | | - | |
842 | | - | |
843 | | - | |
844 | | - | |
845 | | - | |
846 | | - | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
847 | 851 | | |
848 | 852 | | |
849 | 853 | | |
| |||
859 | 863 | | |
860 | 864 | | |
861 | 865 | | |
862 | | - | |
| 866 | + | |
| 867 | + | |
863 | 868 | | |
864 | 869 | | |
865 | 870 | | |
| |||
868 | 873 | | |
869 | 874 | | |
870 | 875 | | |
871 | | - | |
872 | | - | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
873 | 880 | | |
874 | 881 | | |
875 | 882 | | |
876 | 883 | | |
877 | 884 | | |
878 | 885 | | |
879 | | - | |
| 886 | + | |
| 887 | + | |
880 | 888 | | |
881 | 889 | | |
882 | 890 | | |
| |||
899 | 907 | | |
900 | 908 | | |
901 | 909 | | |
902 | | - | |
903 | | - | |
904 | | - | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
905 | 915 | | |
906 | 916 | | |
907 | 917 | | |
| |||
926 | 936 | | |
927 | 937 | | |
928 | 938 | | |
929 | | - | |
| 939 | + | |
| 940 | + | |
930 | 941 | | |
931 | 942 | | |
932 | 943 | | |
933 | 944 | | |
934 | 945 | | |
935 | 946 | | |
936 | | - | |
937 | | - | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
938 | 951 | | |
939 | 952 | | |
940 | 953 | | |
| |||
948 | 961 | | |
949 | 962 | | |
950 | 963 | | |
951 | | - | |
| 964 | + | |
| 965 | + | |
952 | 966 | | |
953 | 967 | | |
954 | 968 | | |
| |||
971 | 985 | | |
972 | 986 | | |
973 | 987 | | |
974 | | - | |
975 | | - | |
976 | | - | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
977 | 993 | | |
978 | 994 | | |
979 | 995 | | |
| |||
0 commit comments