Skip to content

Commit

Permalink
Fix client URL generation bug (#706)
Browse files Browse the repository at this point in the history
  • Loading branch information
vicancy authored Mar 14, 2024
1 parent 32f0e47 commit 0b96529
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,10 @@ function SendEvent(props: APIComponentProps) {
}

const supportedAPIs: SupportedAPI[] = [
{ key: "joinGroup", name: "Join Group", component: JoinGroup },
{ key: "leaveGroup", name: "Leave Group", component: LeaveGroup },
{ key: "sendToGroup", name: "Send to Group", component: SendToGroup },
{ key: "sendEvent", name: "Send Event", component: SendEvent },
{ key: "joinGroup", name: "Join Group", component: JoinGroup },
{ key: "leaveGroup", name: "Leave Group", component: LeaveGroup },
];

function ConnectPane({ connected, onSendingMessage, sendError }: { connected: boolean; sendError: string; onSendingMessage: (message: APIParameters) => void }) {
Expand Down Expand Up @@ -313,6 +313,10 @@ export const SubprotocolClientSection = ({ onStatusChange, url }: ClientPannelPr
return true;
};
const connect = async () => {
// clear the state before start
setError("");
setSendError("");
setTraffic([]);
const connection = new WebPubSubClient(
{
getClientAccessUrl: async () => {
Expand Down
4 changes: 4 additions & 0 deletions tools/awps-tunnel/server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [1.0.0-beta.6] - 2024-03-15
### Fixed
- Fix test client URL generation when env is used

## [1.0.0-beta.5] - 2024-03-11
### Fixed
- Fix test client bugs
Expand Down
2 changes: 1 addition & 1 deletion tools/awps-tunnel/server/dataHub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class DataHub {

async GetClientAccessUrl(userId?: string, roles?: string[], groups?: string[]): Promise<string> {
try {
const url = (this.clientUrl = await this.tunnel.getClientAccessUrl(userId, roles, groups));
const url = (this.clientUrl = await this.tunnel.getClientAccessUrl(userId, roles || [], groups || []));
return url;
} catch (err) {
printer.error(`Unable to get client access URL: ${err}`);
Expand Down
2 changes: 1 addition & 1 deletion tools/awps-tunnel/server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@azure/web-pubsub-tunnel-tool",
"version": "1.0.0-beta.5",
"version": "1.0.0-beta.6",
"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.",
"keywords": [
"azure",
Expand Down

0 comments on commit 0b96529

Please sign in to comment.