Skip to content

Commit 76c146c

Browse files
committed
Refactor team config retrieval to remove user filter
Updated backend methods to retrieve all team configurations without filtering by user ID. Adjusted related service, API, and database interfaces to reflect this change. Added debug logging for WebSocket messages in both backend and frontend for improved traceability.
1 parent 9a70f0f commit 76c146c

File tree

7 files changed

+11
-9
lines changed

7 files changed

+11
-9
lines changed

src/backend/common/database/cosmosdb.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ async def get_team_by_id(self, id: str) -> Optional[TeamConfiguration]:
334334
teams = await self.query_items(query, parameters, TeamConfiguration)
335335
return teams[0] if teams else None
336336

337-
async def get_all_teams_by_user(self, user_id: str) -> List[TeamConfiguration]:
337+
async def get_all_teams(self) -> List[TeamConfiguration]:
338338
"""Retrieve all team configurations for a specific user.
339339
340340
Args:
@@ -343,9 +343,8 @@ async def get_all_teams_by_user(self, user_id: str) -> List[TeamConfiguration]:
343343
Returns:
344344
List of TeamConfiguration objects
345345
"""
346-
query = "SELECT * FROM c WHERE c.user_id=@user_id AND c.data_type=@data_type ORDER BY c.created DESC"
346+
query = "SELECT * FROM c WHERE c.data_type=@data_type ORDER BY c.created DESC"
347347
parameters = [
348-
{"name": "@user_id", "value": user_id},
349348
{"name": "@data_type", "value": DataType.team_config},
350349
]
351350
teams = await self.query_items(query, parameters, TeamConfiguration)

src/backend/common/database/database_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ async def get_team_by_id(self, id: str) -> Optional[TeamConfiguration]:
159159
pass
160160

161161
@abstractmethod
162-
async def get_all_teams_by_user(self, user_id: str) -> List[TeamConfiguration]:
162+
async def get_all_teams(self) -> List[TeamConfiguration]:
163163
"""Retrieve all team configurations for the given user."""
164164
pass
165165

src/backend/v3/api/router.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ async def get_team_configs(request: Request):
688688
team_service = TeamService(memory_store)
689689

690690
# Retrieve all team configurations
691-
team_configs = await team_service.get_all_team_configurations(user_id)
691+
team_configs = await team_service.get_all_team_configurations()
692692

693693
# Convert to dictionaries for response
694694
configs_dict = [config.model_dump() for config in team_configs]

src/backend/v3/common/services/team_service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ async def handle_team_selection(self, user_id: str, team_id: str) -> bool:
271271
return False
272272

273273
async def get_all_team_configurations(
274-
self, user_id: str
274+
self
275275
) -> List[TeamConfiguration]:
276276
"""
277277
Retrieve all team configurations for a user.
@@ -283,8 +283,8 @@ async def get_all_team_configurations(
283283
List of TeamConfiguration objects
284284
"""
285285
try:
286-
# Use the specific get_all_teams_by_user method
287-
team_configs = await self.memory_context.get_all_teams_by_user(user_id)
286+
# Use the specific get_all_teams method
287+
team_configs = await self.memory_context.get_all_teams()
288288
return team_configs
289289

290290
except (KeyError, TypeError, ValueError) as e:

src/backend/v3/config/settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,13 @@ async def send_status_update_async(
199199
)
200200
return
201201

202+
print(f" websocket {message}")
202203
try:
203204
if hasattr(message, "data") and hasattr(message, "type"):
204205
message = message.data
205206
except Exception as e:
206207
print(f"Error loading message data: {e}")
207-
208+
print(f" websocket after {message}")
208209
standard_message = {
209210
"type": message_type,
210211
"data": message

src/backend/v3/magentic_agents/proxy_agent.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ async def reduce(self) -> ChatHistory | None:
8181
return None
8282
return await self._chat_history.reduce()
8383

84+
8485
class ProxyAgentResponseItem:
8586
"""Response item wrapper for proxy agent responses."""
8687

src/frontend/src/services/WebSocketService.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ class WebSocketService {
168168

169169
//console.log('WebSocket message received:', message);
170170
const hasClarification = /\bclarifications?\b/i.test(message.data || '');
171+
console.log("Message ':", message);
171172
if (hasClarification) {
172173
console.log("Message contains 'clarification':", message.data);
173174
}

0 commit comments

Comments
 (0)