Skip to content

[STREAM-1179] Allow a streaming-client instance to be marked as alertable#338

Open
hjon wants to merge 7 commits intodevelopfrom
STREAM-1179
Open

[STREAM-1179] Allow a streaming-client instance to be marked as alertable#338
hjon wants to merge 7 commits intodevelopfrom
STREAM-1179

Conversation

@hjon
Copy link
Collaborator

@hjon hjon commented Feb 12, 2026

No description provided.

@hjon hjon force-pushed the STREAM-1179 branch 4 times, most recently from 0229a40 to be45ecb Compare February 14, 2026 01:03
[header: string]: string;
}

export interface IAlertableInteractions extends Object {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't need to extend Object, it should be implicitly extended already.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a regular object or an array? I'm not sure I have a particularly strong opinion, but it did initially seem strange for this to be an object.

I figured we'd do this somewhat like we do allowedSessionTypes in the SDK - so it'd be something like ['voice', 'digital'] in the future. I suppose this lets us get even more specific within the space of digital but even then we could always make this an array of objects.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll think about that. I don't quite remember why I landed here, but the reasons may no longer be relevant.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took another look and I think I agree with you. I suspect I had a certain idea of how this would be used that didn't pan out.

(I think Max made a similar suggestion early on, so between the two of you I came around. 🙂)

}

export interface IAlertableInteractions extends Object {
voice?: boolean;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future will we need to add video, digital, etc?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. So to your earlier comment, an array might be just as good.

// STREAM-1204
// There's a race condition between the backend service knowing about the connection
// and us marking the connection as alertable. For now, we'll just retry with some delay.
const maxRetries = 16;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My head says this is a big number but its only eight seconds of retries.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah...of course, "only" eight seconds is rather long...but I'm just trying to avoid any issues until we can improve it (I hope).


if (this.config.jid) {
jidPromise = Promise.resolve(this.config.jid);
if (this.config.userId && this.config.jid) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be an &&? The userId field is optional it looks.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both userId and jid are optional. But we need the userId for alerting leader, so I didn't want to resolve the promise from the config if we didn't have both.

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.

4 participants