Skip to content

Commit 0b96529

Browse files
authored
Fix client URL generation bug (#706)
1 parent 32f0e47 commit 0b96529

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

tools/awps-tunnel/client/src/panels/sections/SubprotocolClientSection.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,10 @@ function SendEvent(props: APIComponentProps) {
208208
}
209209

210210
const supportedAPIs: SupportedAPI[] = [
211-
{ key: "joinGroup", name: "Join Group", component: JoinGroup },
212-
{ key: "leaveGroup", name: "Leave Group", component: LeaveGroup },
213211
{ key: "sendToGroup", name: "Send to Group", component: SendToGroup },
214212
{ key: "sendEvent", name: "Send Event", component: SendEvent },
213+
{ key: "joinGroup", name: "Join Group", component: JoinGroup },
214+
{ key: "leaveGroup", name: "Leave Group", component: LeaveGroup },
215215
];
216216

217217
function ConnectPane({ connected, onSendingMessage, sendError }: { connected: boolean; sendError: string; onSendingMessage: (message: APIParameters) => void }) {
@@ -313,6 +313,10 @@ export const SubprotocolClientSection = ({ onStatusChange, url }: ClientPannelPr
313313
return true;
314314
};
315315
const connect = async () => {
316+
// clear the state before start
317+
setError("");
318+
setSendError("");
319+
setTraffic([]);
316320
const connection = new WebPubSubClient(
317321
{
318322
getClientAccessUrl: async () => {

tools/awps-tunnel/server/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [1.0.0-beta.6] - 2024-03-15
4+
### Fixed
5+
- Fix test client URL generation when env is used
6+
37
## [1.0.0-beta.5] - 2024-03-11
48
### Fixed
59
- Fix test client bugs

tools/awps-tunnel/server/dataHub.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export class DataHub {
114114

115115
async GetClientAccessUrl(userId?: string, roles?: string[], groups?: string[]): Promise<string> {
116116
try {
117-
const url = (this.clientUrl = await this.tunnel.getClientAccessUrl(userId, roles, groups));
117+
const url = (this.clientUrl = await this.tunnel.getClientAccessUrl(userId, roles || [], groups || []));
118118
return url;
119119
} catch (err) {
120120
printer.error(`Unable to get client access URL: ${err}`);

tools/awps-tunnel/server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@azure/web-pubsub-tunnel-tool",
3-
"version": "1.0.0-beta.5",
3+
"version": "1.0.0-beta.6",
44
"description": "A local tool to help tunnel Azure Web PubSub traffic to local web app and provide a vivid view to the end to end workflow.",
55
"keywords": [
66
"azure",

0 commit comments

Comments
 (0)