diff --git a/src/WayfarerMobile.Core/Interfaces/ISseClient.cs b/src/WayfarerMobile.Core/Interfaces/ISseClient.cs
index 1987786..d758afd 100644
--- a/src/WayfarerMobile.Core/Interfaces/ISseClient.cs
+++ b/src/WayfarerMobile.Core/Interfaces/ISseClient.cs
@@ -71,14 +71,6 @@ public interface ISseClient : IDisposable
#region Methods
- ///
- /// Subscribe to per-user SSE channel for location updates.
- ///
- /// Username to subscribe to.
- /// Token to cancel the subscription.
- /// Task that completes when subscription ends.
- Task SubscribeToUserAsync(string userName, CancellationToken cancellationToken = default);
-
///
/// Subscribe to consolidated group SSE channel for location and membership updates.
/// All event types (location, visibility-changed, member-left, etc.) come through this single stream.
diff --git a/src/WayfarerMobile.Core/Models/SseEventModels.cs b/src/WayfarerMobile.Core/Models/SseEventModels.cs
index db79d1d..31eb3b0 100644
--- a/src/WayfarerMobile.Core/Models/SseEventModels.cs
+++ b/src/WayfarerMobile.Core/Models/SseEventModels.cs
@@ -2,7 +2,7 @@ namespace WayfarerMobile.Core.Models;
///
/// SSE event for location updates.
-/// Received from channels: location-update-{userName} or group-{groupId} (consolidated)
+/// Received from the consolidated group-{groupId} channel.
///
public class SseLocationEvent
{
diff --git a/src/WayfarerMobile/Services/SseClient.cs b/src/WayfarerMobile/Services/SseClient.cs
index 7710f5d..d981e7d 100644
--- a/src/WayfarerMobile/Services/SseClient.cs
+++ b/src/WayfarerMobile/Services/SseClient.cs
@@ -125,26 +125,6 @@ public SseClient(
#region Public Methods
- ///
- public async Task SubscribeToUserAsync(string userName, CancellationToken cancellationToken = default)
- {
- if (string.IsNullOrWhiteSpace(userName))
- {
- _logger.LogWarning("Cannot subscribe to SSE: userName is empty");
- return;
- }
-
- string? serverUrl = _settings.ServerUrl;
- if (string.IsNullOrWhiteSpace(serverUrl))
- {
- _logger.LogError("Server URL not configured for SSE subscription");
- return;
- }
-
- string url = $"{serverUrl.TrimEnd('/')}/api/mobile/sse/location-update/{Uri.EscapeDataString(userName)}";
- await SubscribeAsync(url, $"user:{userName}", cancellationToken).ConfigureAwait(false);
- }
-
///
public async Task SubscribeToGroupAsync(string groupId, CancellationToken cancellationToken = default)
{
diff --git a/tests/WayfarerMobile.Tests/Unit/Services/SseClientTests.cs b/tests/WayfarerMobile.Tests/Unit/Services/SseClientTests.cs
index 13ba0fc..736db6a 100644
--- a/tests/WayfarerMobile.Tests/Unit/Services/SseClientTests.cs
+++ b/tests/WayfarerMobile.Tests/Unit/Services/SseClientTests.cs
@@ -161,47 +161,6 @@ public void Reconnecting_CanSubscribeAndUnsubscribe()
eventRaised.Should().BeFalse();
}
- [Fact]
- public async Task SubscribeToUserAsync_EmptyUserName_LogsWarningAndReturns()
- {
- var client = CreateClient();
- await client.SubscribeToUserAsync(string.Empty);
- client.IsConnected.Should().BeFalse();
- }
-
- [Fact]
- public async Task SubscribeToUserAsync_NoServerUrl_LogsErrorAndReturns()
- {
- _mockSettings.Setup(s => s.ServerUrl).Returns((string?)null);
- var client = CreateClient();
- await client.SubscribeToUserAsync("testuser");
- client.IsConnected.Should().BeFalse();
- }
-
- [Fact]
- public async Task SubscribeToUserAsync_ValidUserName_BuildsCorrectUrl()
- {
- _mockSettings.Setup(s => s.ServerUrl).Returns("https://api.example.com");
- string? capturedUrl = null;
-
- _mockHttpHandler
- .Protected()
- .Setup>(
- "SendAsync",
- ItExpr.IsAny(),
- ItExpr.IsAny())
- .Callback((req, _) => capturedUrl = req.RequestUri?.ToString())
- .ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent("") });
-
- var client = CreateClient();
- using var cts = new CancellationTokenSource(100);
- try { await client.SubscribeToUserAsync("testuser", cts.Token); }
- catch (OperationCanceledException) { }
- catch (HttpRequestException) { }
-
- capturedUrl.Should().Be("https://api.example.com/api/mobile/sse/location-update/testuser");
- }
-
[Fact]
public async Task SubscribeToGroupAsync_EmptyGroupId_LogsWarningAndReturns()
{
@@ -252,7 +211,7 @@ public async Task Subscribe_SetsAuthorizationHeader()
var client = CreateClient();
using var cts = new CancellationTokenSource(100);
- try { await client.SubscribeToUserAsync("testuser", cts.Token); }
+ try { await client.SubscribeToGroupAsync("group-abc-123", cts.Token); }
catch (OperationCanceledException) { }
catch (HttpRequestException) { }
@@ -277,7 +236,7 @@ public async Task Subscribe_SetsAcceptHeader()
var client = CreateClient();
using var cts = new CancellationTokenSource(100);
- try { await client.SubscribeToUserAsync("testuser", cts.Token); }
+ try { await client.SubscribeToGroupAsync("group-abc-123", cts.Token); }
catch (OperationCanceledException) { }
catch (HttpRequestException) { }
@@ -535,15 +494,6 @@ public TestSseClient(ISettingsService settings, ILogger logger, I
_httpClientFactory = httpClientFactory ?? throw new ArgumentNullException(nameof(httpClientFactory));
}
- public Task SubscribeToUserAsync(string userName, CancellationToken cancellationToken = default)
- {
- if (string.IsNullOrWhiteSpace(userName)) { _logger.LogWarning("userName is empty"); return Task.CompletedTask; }
- var serverUrl = _settings.ServerUrl;
- if (string.IsNullOrWhiteSpace(serverUrl)) { _logger.LogError("Server URL not configured"); return Task.CompletedTask; }
- var url = serverUrl.TrimEnd((char)47) + "/api/mobile/sse/location-update/" + Uri.EscapeDataString(userName);
- return SubscribeAsync(url, "user:" + userName, cancellationToken);
- }
-
public Task SubscribeToGroupAsync(string groupId, CancellationToken cancellationToken = default)
{
if (string.IsNullOrWhiteSpace(groupId)) { _logger.LogWarning("groupId is empty"); return Task.CompletedTask; }