[READ-ONLY] Mirror of https://github.com/improsocial/impro An extensible Bluesky client for web impro.social
6

Configure Feed

Select the types of activity you want to include in your feed.

Redirect to group chat on join

Grace Kind (Jun 29, 2026, 2:38 PM -0500) 867fdfbc 96cc7455

+58 -6
+1 -1
package.json
··· 1 1 { 2 2 "name": "impro", 3 - "version": "0.17.77", 3 + "version": "0.17.78", 4 4 "type": "module", 5 5 "scripts": { 6 6 "start": "rm -rf \"${BUILD_DIR:-build}\" && NODE_ENV=development eleventy --serve",
+8 -3
src/js/groupChatLinkService.js
··· 104 104 if (actionType === "join" || actionType === "request") { 105 105 JoinChatModal.open({ 106 106 preview, 107 - onSubmit: () => this._submit(preview), 107 + onSubmit: () => this.handleJoinChatModalSubmit(preview), 108 108 }); 109 109 return; 110 110 } ··· 115 115 } 116 116 } 117 117 118 - async _submit(preview) { 118 + async handleJoinChatModalSubmit(preview) { 119 119 try { 120 - await this.dataLayer.mutations.requestJoinGroupChat(preview.code); 120 + const res = await this.dataLayer.mutations.requestJoinGroupChat( 121 + preview.code, 122 + ); 121 123 showToast( 122 124 preview.requireApproval 123 125 ? "Request sent — the group owner will review your request." 124 126 : "Joined group chat", 125 127 { style: "success" }, 126 128 ); 129 + if (res?.status === "joined" && res.convo?.id) { 130 + window.router.go(`/messages/${res.convo.id}`); 131 + } 127 132 } catch (error) { 128 133 console.error(error); 129 134 showToast("Could not send join request. Please try again.", {
+16 -2
tests/e2e/mockServer.js
··· 15 15 this.convoMessages = new Map(); 16 16 this.chatLogs = []; 17 17 this.joinLinkPreviews = new Map(); 18 + this.joinLinkJoinedConvos = new Map(); 18 19 this.failJoinLinkCodes = new Set(); 19 20 this.createRecordCounter = 0; 20 21 this.interactionPayloads = []; ··· 253 254 254 255 failJoinLinkRequest(code) { 255 256 this.failJoinLinkCodes.add(code); 257 + } 258 + 259 + setJoinLinkJoinedConvo(code, convo) { 260 + this.joinLinkJoinedConvos.set(code, convo); 256 261 } 257 262 258 263 // Abort all subsequent document navigations (reloads, redirects) so the ··· 750 755 }); 751 756 } 752 757 const preview = this.joinLinkPreviews.get(code); 758 + const joinedConvo = 759 + preview?.requireApproval === false 760 + ? this.joinLinkJoinedConvos.get(code) 761 + : null; 753 762 if (preview?.$type === "chat.bsky.group.defs#joinLinkPreviewView") { 754 763 this.joinLinkPreviews.set(code, { 755 764 ...preview, 765 + ...(joinedConvo ? { convo: joinedConvo } : {}), 756 766 viewer: { 757 767 ...(preview.viewer ?? {}), 758 - requestedAt: new Date().toISOString(), 768 + ...(joinedConvo ? {} : { requestedAt: new Date().toISOString() }), 759 769 }, 760 770 }); 761 771 } 762 772 return route.fulfill({ 763 773 status: 200, 764 774 contentType: "application/json", 765 - body: JSON.stringify({ status: "pending" }), 775 + body: JSON.stringify( 776 + joinedConvo 777 + ? { status: "joined", convo: joinedConvo } 778 + : { status: "pending" }, 779 + ), 766 780 }); 767 781 }); 768 782
+33
tests/e2e/specs/flows/joinLinkEmbed.test.js
··· 281 281 }); 282 282 }); 283 283 284 + test("on open-join success, navigates to the joined chat", async ({ 285 + page, 286 + }) => { 287 + const owner = createProfile({ 288 + did: "did:plc:owner", 289 + handle: "owner.bsky.social", 290 + displayName: "Owner", 291 + }); 292 + const joinedConvo = createConvo({ 293 + id: "joined-convo", 294 + otherMember: owner, 295 + }); 296 + const mockServer = new MockServer(); 297 + mockServer.addConvos([joinedConvo]); 298 + mockServer.addConvoMessages("joined-convo", []); 299 + mockServer.setJoinLinkJoinedConvo("abcd1234", joinedConvo); 300 + await setupInvitePostThread(page, makeJoinLinkPreview(), { mockServer }); 301 + await login(page); 302 + await page.goto(postPath); 303 + 304 + const action = page.locator('[data-testid="join-link-embed-action"]'); 305 + await expect(action).toHaveAttribute("data-teststate", "join", { 306 + timeout: 10000, 307 + }); 308 + await action.click(); 309 + await page.locator('[data-testid="modal-confirm-button"]').click(); 310 + 311 + await expect(page).toHaveURL(/\/messages\/joined-convo$/, { 312 + timeout: 10000, 313 + }); 314 + await expect(page.locator("#chat-detail-view")).toBeVisible(); 315 + }); 316 + 284 317 test("on failure, the dialog stays open and an error toast appears", async ({ 285 318 page, 286 319 }) => {