Skip to content

Fix notification navigator not recognizing ChannelActivity notifications - #1667

Open
LuisMend12 wants to merge 3 commits into
Valour-Software:mainfrom
LuisMend12:fix/notification-activity-navigation
Open

Fix notification navigator not recognizing ChannelActivity notifications#1667
LuisMend12 wants to merge 3 commits into
Valour-Software:mainfrom
LuisMend12:fix/notification-activity-navigation

Conversation

@LuisMend12

Copy link
Copy Markdown
Contributor

Summary

Fixes #1665.

Channel activity notifications ("N messages from M people in ...", see ChannelActivityService.cs) are created with Source = NotificationSource.ChannelActivity and the same PlanetId/ChannelId/SourceId/ClickUrl shape as planet mention notifications (/planetchannels/{planetId}/{channelId}/{messageId}). NotificationNavigator.NavigateTo's switch never listed ChannelActivity, so it always fell through to the default case and showed "This notification doesn't have a destination." instead of opening the channel at the triggering message — exactly the "Couldn't Open Notification" report in #1665.

  • Adds NotificationSource.ChannelActivity to the planet-channel-route case.
  • Pulls that case grouping into a single internal static bool IsPlanetChannelRouteSource(NotificationSource) predicate, used by the switch itself (case var source when IsPlanetChannelRouteSource(source):), so there's one source of truth and it's directly unit-testable without needing a live client/JS runtime for the rest of NavigateTo.

Test plan

  • Added Valour/Tests/Client/NotificationNavigatorTests.cs — asserts all five existing planet-route sources plus the new ChannelActivity route to true, and DM/thread/friend/event-reminder/platform sources stay false.
  • dotnet build Valour/Tests/Valour.Tests.csproj — succeeds (no new warnings/errors).
  • dotnet test filtered to NotificationNavigatorTests — 15/15 pass.
  • dotnet test on the full non-DB-dependent Valour.Tests.Client namespace (78 tests) — all pass, no regressions.

…ations

Fixes Valour-Software#1665. Channel activity ("N messages from M people") notifications
carry the same PlanetId/ChannelId/SourceId/ClickUrl shape as planet
mention notifications, but NotificationSource.ChannelActivity wasn't in
NotificationNavigator's switch, so clicking "View" always fell through to
the default case and showed "This notification doesn't have a
destination." instead of opening the channel at the triggering message.

The planet-channel-route case grouping is pulled into a single
IsPlanetChannelRouteSource predicate (used by the switch itself) so it can
be exercised directly in NotificationNavigatorTests without needing a live
client/JS runtime for the rest of NavigateTo.
@LuisMend12
LuisMend12 requested a review from a team as a code owner August 22, 2026 16:19
Comment thread Valour/Client/Utility/NotificationNavigator.cs Outdated
Comment thread Valour/Tests/Client/NotificationNavigatorTests.cs Outdated
LuisMend12 and others added 2 commits August 22, 2026 13:15
Co-authored-by: Vitaly Orekhov <vkvo2000@vivaldi.net>
Co-authored-by: Vitaly Orekhov <vkvo2000@vivaldi.net>
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.

🐛 Bug - Unable to view Notifcation Messages

2 participants