fix: settings save and session deletion bugs

Settings save:
- Remove exclude_none=True from user_config.py model_dump() call
- Fixes fields not updating when cleared or set to null/undefined

Session deletion:
- Add project_id and repository_id to get_user_sessions response
- Update frontend Session interface with new fields
- Fix handleDelete to use IDs instead of names, resolving 404 errors
This commit is contained in:
Fusion
2026-05-20 11:20:43 +02:00
parent ad09ffa6ec
commit f824a1e6fe
4 changed files with 7 additions and 4 deletions
+2 -1
View File
@@ -762,9 +762,10 @@ async def get_user_sessions(
"display_name": instance.display_name,
"tool_type_name": tool_type.name if tool_type else "unknown",
"tool_icon": tool_type.name if tool_type else "code",
"tool_type_interfaces": tool_type.interfaces if tool_type else [],
"repository_name": repo.name if repo else "unknown",
"repository_id": str(instance.repository_id),
"project_name": project.name if project else "unknown",
"project_id": str(instance.project_id),
"status": instance.status,
"url": instance.url,
})
+1 -1
View File
@@ -110,7 +110,7 @@ async def update_user_config(
config = await _get_or_create_config(session, user_id)
# Merge updates
update_data = data.model_dump(exclude_unset=True, exclude_none=True)
update_data = data.model_dump(exclude_unset=True)
logger.info("Updating user config for user %s: %s", user_id, update_data)
config.config.update(update_data)
+2
View File
@@ -20,7 +20,9 @@ export interface Session {
tool_icon: string;
tool_type_interfaces: string[];
repository_name: string;
repository_id: string;
project_name: string;
project_id: string;
status: string;
url: string | null;
}
+2 -2
View File
@@ -289,8 +289,8 @@ export const SessionsPage = () => {
onClick={() =>
void handleDelete(
session.id,
projects.find((p) => p.name === session.project_name)?.id ?? "",
""
session.project_id,
session.repository_id
)
}
type="button"