Skip to content

Commit

Permalink
Region URL Provider (#642)
Browse files Browse the repository at this point in the history
* update protocol

* wip

* region provider for reconnects

* update protocol reference

* reset attempts

* move some logic into rtc engine

* remove debug logs

* move helper into utils

* remove more debug stuff

* cleanup

* Create .changeset/wild-cars-compete.md

* address comments

* reject connection promise instead of throwing error
  • Loading branch information
lukasIO authored Apr 17, 2023
1 parent 80ec8d7 commit dd381f1
Show file tree
Hide file tree
Showing 12 changed files with 2,350 additions and 678 deletions.
5 changes: 5 additions & 0 deletions .changeset/wild-cars-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"livekit-client": patch
---

Add Region URL Provider
2 changes: 1 addition & 1 deletion src/api/SignalClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export class SignalClient {
return new Promise<JoinResponse | ReconnectResponse | void>(async (resolve, reject) => {
const abortHandler = async () => {
await this.close();
reject(new ConnectionError('room connection has been cancelled'));
reject(new ConnectionError('room connection has been cancelled (signal)'));
};

if (abortSignal?.aborted) {
Expand Down
21 changes: 15 additions & 6 deletions src/proto/google/protobuf/timestamp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,22 +127,31 @@ export const Timestamp = {
},

decode(input: _m0.Reader | Uint8Array, length?: number): Timestamp {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseTimestamp();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag != 8) {
break;
}

message.seconds = longToNumber(reader.int64() as Long);
break;
continue;
case 2:
if (tag != 16) {
break;
}

message.nanos = reader.int32();
break;
default:
reader.skipType(tag & 7);
break;
continue;
}
if ((tag & 7) == 4 || tag == 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
Expand Down
Loading

0 comments on commit dd381f1

Please sign in to comment.