Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- Open the notified channel or thread even when an existing app window misses the notification click, while retaining in-page navigation for responsive windows. Thanks @chmac.
- Workspace settings now say to type the workspace name before deleting it, label that field for screen readers, and show "No eligible members" instead of a blank transfer menu. Thanks @KrasimirKralev.
- Build with Go 1.27.4 to fix the reachable HTTP/1 header race (GO-2026-6859), retaining the Go 1.26.6 module minimum.

Expand Down
11 changes: 5 additions & 6 deletions apps/api/internal/httpapi/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,16 @@ func webPushTag(message store.Message) string {
return "clickclack:" + message.ID
}

// webPushURL routes a tap to the conversation or channel the message belongs
// to. A thread reply lands in its channel: message routes are minted on
// demand. The workspace segment is a storage id, and the route API resolves
// only storage targets beside one, so the target is always a storage id too
// (never a channel's route id) and the app canonicalizes the pair on arrival,
// as it does for an in-page notification with no route id to hand.
// webPushURL pairs storage IDs so the route API can canonicalize the target.
// Thread routes are allocated lazily when the recipient opens the root.
func webPushURL(message store.Message) string {
target := message.ChannelID
if message.DirectConversationID != "" {
target = message.DirectConversationID
}
if message.ParentMessageID != nil && message.ThreadRootID != "" {
target = message.ThreadRootID
}
if message.WorkspaceID == "" || target == "" {
return "/app"
}
Expand Down
21 changes: 19 additions & 2 deletions apps/api/internal/httpapi/webpush_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ func TestWebPushTapURLResolvesToTheChannel(t *testing.T) {
}).Handler())
t.Cleanup(server.Close)

postJSON[struct {
root := postJSON[struct {
Message store.Message `json:"message"`
}](t, server.URL+"/api/channels/"+channel.ID+"/messages", map[string]any{"body": "over here"})
if len(web.notifications) != 1 {
Expand All @@ -1035,6 +1035,23 @@ func TestWebPushTapURLResolvesToTheChannel(t *testing.T) {
resolved.Route.CanonicalPath != "/app/"+workspace.RouteID+"/"+channel.RouteID {
t.Fatalf("the tap must resolve to the channel it names: %#v", resolved.Route)
}
postJSON[struct {
Message store.Message `json:"message"`
}](t, server.URL+"/api/messages/"+root.Message.ID+"/thread/replies", map[string]any{"body": "thread reply"})
if len(web.notifications) != 2 {
t.Fatalf("expected thread reply notification, got %#v", web.notifications)
}
tap = web.notifications[1].URL
if tap != "/app/"+workspace.ID+"/"+root.Message.ID {
t.Fatalf("reply tap must name its thread root, got %q", tap)
}
resolved = getJSONAsUser[struct {
Route store.RouteTarget `json:"route"`
}](t, recipient.ID, server.URL+"/api/routes"+strings.TrimPrefix(tap, "/app"))
if resolved.Route.TargetType != "thread" || resolved.Route.TargetID != root.Message.ID || resolved.Route.ParentID != channel.ID {
t.Fatalf("reply tap must resolve its thread and channel: %#v", resolved.Route)
}

}

func TestWebPushTitleNamesThePlaceItKnows(t *testing.T) {
Expand Down Expand Up @@ -1082,7 +1099,7 @@ func TestWebPushBodyAndRouteDescribeTheMessage(t *testing.T) {
t.Fatalf("channel route is %q", got)
}
thread := store.Message{WorkspaceID: "wsp_1", ChannelID: "chn_1", ParentMessageID: &parent, ThreadRootID: parent}
if got := webPushURL(thread); got != "/app/wsp_1/chn_1" {
if got := webPushURL(thread); got != "/app/wsp_1/msg_root" {
t.Fatalf("thread route is %q", got)
}
dm := store.Message{WorkspaceID: "wsp_1", DirectConversationID: "dm_1"}
Expand Down
4 changes: 2 additions & 2 deletions apps/api/internal/webassets/dist/200.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
<link href="/_app/immutable/chunks/Cg3pm-K7.js" rel="modulepreload">
<link href="/_app/immutable/chunks/Dek69VGa.js" rel="modulepreload">
<link href="/_app/immutable/chunks/C7ceXZWF.js" rel="modulepreload">
<link href="/_app/immutable/entry/app.2dgjf5Ov.js" rel="modulepreload">
<link href="/_app/immutable/entry/app.DUQG9DYm.js" rel="modulepreload">
<link href="/_app/immutable/nodes/0.CaM-kUrk.js" rel="modulepreload">
<link href="/_app/immutable/chunks/DK3Fl9T5.js" rel="modulepreload">
<link href="/_app/immutable/chunks/BJnJ0WUy.js" rel="modulepreload">
Expand All @@ -136,7 +136,7 @@

import("/_app/immutable/entry/start.BT73xe8L.js").then(async (kit) => {
kit.init(__sveltekit_375u9e);
const app = await import("/_app/immutable/entry/app.2dgjf5Ov.js");
const app = await import("/_app/immutable/entry/app.DUQG9DYm.js");
kit.start(app, element);
});
}
Expand Down

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions apps/api/internal/webassets/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@
<link href="./_app/immutable/chunks/Cg3pm-K7.js" rel="modulepreload">
<link href="./_app/immutable/chunks/Dek69VGa.js" rel="modulepreload">
<link href="./_app/immutable/chunks/C7ceXZWF.js" rel="modulepreload">
<link href="./_app/immutable/entry/app.2dgjf5Ov.js" rel="modulepreload">
<link href="./_app/immutable/entry/app.DUQG9DYm.js" rel="modulepreload">
<link href="./_app/immutable/nodes/0.CaM-kUrk.js" rel="modulepreload">
<link href="./_app/immutable/chunks/DK3Fl9T5.js" rel="modulepreload">
<link href="./_app/immutable/chunks/BJnJ0WUy.js" rel="modulepreload">
<link href="./_app/immutable/chunks/Dqjw8vaP.js" rel="modulepreload">
<link href="./_app/immutable/chunks/DEPNME54.js" rel="modulepreload">
<link href="./_app/immutable/nodes/3.BP3QQiq-.js" rel="modulepreload">
<link href="./_app/immutable/nodes/3.BEYHK7x1.js" rel="modulepreload">
<link href="./_app/immutable/chunks/B0KjTaKD.js" rel="modulepreload">

<link href="./_app/immutable/assets/0.DCnwR7ce.css" rel="stylesheet">
Expand All @@ -139,7 +139,7 @@

import("./_app/immutable/entry/start.BT73xe8L.js").then(async (kit) => {
kit.init(__sveltekit_375u9e);
const app = await import("./_app/immutable/entry/app.2dgjf5Ov.js");
const app = await import("./_app/immutable/entry/app.DUQG9DYm.js");
kit.start(app, element);
});
}
Expand Down
Loading
Loading