Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 21, 2026

When a welcome post is deleted, squad member join notifications link to a non-existent post and suggest users comment on it. Users click the notification and encounter a 404, and the message is misleading.

Changes

Notification generation (src/notifications/generate.ts):

  • Check post.deleted flag in squad_member_joined builder and title
  • If deleted: use targetSource() to link to squad page and remove comment suggestion from message
  • If not deleted: preserve existing behavior (link to post with comment suggestion)

Test coverage (__tests__/notifications/index.ts):

  • Added test case verifying squad page link when welcome post is deleted
  • Added test assertion for notification title without comment mention

Examples

Notification builder:

squad_member_joined: (builder, ctx) => {
  const baseBuilder = builder
    .icon(NotificationIcon.Bell)
    .referenceSource(ctx.source)
    .avatarSource(ctx.source)
    .avatarManyUsers([ctx.doneBy])
    .uniqueKey(ctx.doneBy.id);

  // Link to squad page if welcome post deleted
  if (ctx.post.deleted) {
    return baseBuilder.targetSource(ctx.source);
  }

  // Otherwise link to post with comment suggestion
  return baseBuilder
    .targetPost(ctx.post)
    .setTargetUrlParameter(/* ... */);
},

Notification title:

squad_member_joined: (ctx) => {
  const baseMessage = `Your squad <b>${ctx.source.name}</b> is growing! Welcome <b>${ctx.doneBy.name}</b> to the squad`;
  // Don't mention commenting when welcome post is deleted
  return ctx.post.deleted
    ? `${baseMessage}.`
    : `${baseMessage} with a comment.`;
},
Original prompt

When someone joins the squad and the welcome post is deleted, update the notification so that it does not link to the welcome page


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@CLAassistant
Copy link

CLAassistant commented Jan 21, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ omBratteng
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

…me post is deleted

Co-authored-by: omBratteng <1681525+omBratteng@users.noreply.github.com>
Copilot AI changed the title [WIP] Update notification link after welcome post deletion Fix squad member join notification to link to squad page when welcome post deleted Jan 21, 2026
Copilot AI requested a review from omBratteng January 21, 2026 07:20
@omBratteng
Copy link
Member

@copilot Also update the notification message so that it no longer says anything about a comment when the welcome post is deleted

…st is deleted

Co-authored-by: omBratteng <1681525+omBratteng@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 21, 2026

@copilot Also update the notification message so that it no longer says anything about a comment when the welcome post is deleted

Updated in d6efa3e. The notification title now conditionally excludes "with a comment" when the welcome post is deleted.

Copilot AI changed the title Fix squad member join notification to link to squad page when welcome post deleted Fix squad member join notification when welcome post is deleted Jan 21, 2026
@omBratteng omBratteng changed the title Fix squad member join notification when welcome post is deleted fix: squad member join notification when welcome post is deleted Jan 21, 2026
@omBratteng omBratteng marked this pull request as ready for review January 21, 2026 09:37
@omBratteng omBratteng requested review from a team and capJavert as code owners January 21, 2026 09:37
@omBratteng omBratteng enabled auto-merge (squash) January 21, 2026 10:03
@omBratteng omBratteng disabled auto-merge January 21, 2026 10:12
@omBratteng omBratteng merged commit 0a9291c into main Jan 21, 2026
9 of 10 checks passed
@omBratteng omBratteng deleted the copilot/update-notification-link branch January 21, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants