You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,9 @@
6
6
- fix: pick the expiry rounding strategy based on the delta, without adding the clock drift to the delta.
7
7
- feat: adds a `clockDriftMs` optional parameter to `Expiry.fromDeltaInMilliseconds` to add to the current time, typically used to specify the clock drift between the client's clock and the IC network clock.
8
8
- fix: account for clock drift when verifying the certificate freshness.
9
-
- feat: adds the `timeDiffMsecs` optional field to the `CreateCertificateOptions` interface, which allows you to adjust the current time when verifying the certificate freshness.
10
-
- feat: adds the `getTimeDiffMsecs` function to the `HttpAgent` class, which returns the time difference in milliseconds between the client's clock and the IC network clock. It also adds the `getTimeDiffMsecs` function to handle the case where the agent is not an instance of `HttpAgent`.
9
+
- feat: adds the `currentTime` optional field to the `CreateCertificateOptions` interface, which allows you to override the current time when verifying the certificate freshness.
10
+
- feat: adds the `getTimeDiffMsecs` function to the `HttpAgent` class, which returns the time difference in milliseconds between the client's clock and the IC network clock.
11
+
- feat: adds the `getAdjustedCurrentTime` to compute the current time adjusted by the input agent's time difference in milliseconds, if the agent is an instance of `HttpAgent`.
Copy file name to clipboardExpand all lines: packages/agent/src/agent/http/index.ts
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1415,15 +1415,15 @@ export function calculateIngressExpiry(
1415
1415
}
1416
1416
1417
1417
/**
1418
-
* Retrieves the time difference in milliseconds between the client's clock and the IC network clock.
1419
-
* See {@link HttpAgent.getTimeDiffMsecs} for more details.
1418
+
* Computes the current time adjusted by the time difference in milliseconds returned by {@link HttpAgent.getTimeDiffMsecs}.
1420
1419
* @param agent The agent to retrieve the `timeDiffMsecs` property from.
1421
-
* @returns The time difference in milliseconds between the client's clock and the IC network clock,
1422
-
* if the agent is an {@link HttpAgent} instance. `undefined` otherwise.
1420
+
* @returns The current time adjusted by the agent's time difference in milliseconds. If the agent is not an {@link HttpAgent} instance, fallbacks to the system's current timestamp.
0 commit comments