-
Notifications
You must be signed in to change notification settings - Fork 532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to provide exception handler for timer's callback #20745
Conversation
⯅ @fluid-example/bundle-size-tests: +468 Bytes
Baseline commit: efb82f8 |
@@ -138,7 +138,7 @@ export function setLongTimeout(timeoutFn: () => void, timeoutMs: number, setTime | |||
|
|||
// @internal | |||
export class Timer implements ITimer { | |||
constructor(defaultTimeout: number, defaultHandler: () => void, getCurrentTick?: () => number); | |||
constructor(defaultTimeout: number, defaultHandler: () => void, exceptionHandler?: ((error: unknown) => void) | undefined); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we specified the type of error here as any, then we could keep the other error types preserved which you had to change below to unknown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you mean. unknown is safer than any, as any could be implicitly casted by compiler to any type, so it's easy to introduce a bug without noticing it.
The only casts I see is in UT and they are unrelated to this handler - they are there because compiler does not understand that clock.tick() has side-effects, so it thinks that exceptionCounter is always one (after first assert).
… using "read" connection. (#20817) First step to enable Audience to have same behavior for "read" and "write" clients - "connected" event raised when "self" is present in Audience. Next step: - client is caught up with latest ops. For deeper description of work in this space, please see first PR below. This is continuation of this work: - #20703 - #20752 - #20704 - #20745 - #20766 And active PRs (do not block this PR, but make whole story more consistent for serialized / rehydrated containers): - #20768 - #20767 Changeset added in previous PR in the same version (part of it should have been included in this PR, but made it earlier by accident): [.changeset/cruel-trees-dance.md](https://github.com/microsoft/FluidFramework/pull/20215/files#diff-8f706b3e769f698985bea8fbf9bb3fb0a0a8798de53ad3f51cbace1dd3d1d2b2)
…d" event when using "read" connections. (#20854) Enable Audience to have same behavior for "read" and "write" clients: - "connected" event raised when we caught up on ops. For deeper description of work in this space, please see first PR below. This is continuation of this work: - #20703 - #20752 - #20704 - #20745 - #20766 - #20817 And active PRs (do not block this PR, but make whole story more consistent for serialized / rehydrated containers): - #20767 Changeset added in previous PR in the same version (part of it should have been included in this PR, but made it earlier by accident): [.changeset/cruel-trees-dance.md](https://github.com/microsoft/FluidFramework/pull/20215/files#diff-8f706b3e769f698985bea8fbf9bb3fb0a0a8798de53ad3f51cbace1dd3d1d2b2)
Not much to add here...