fix server - agent

This commit is contained in:
2026-05-27 08:37:47 +07:00
parent 13765e58d2
commit b0443d5950
13 changed files with 170 additions and 11 deletions

View File

@@ -160,7 +160,7 @@ class Repository:
with get_connection() as connection:
rows = connection.execute(
"""
SELECT app_id, app_name, version, manifest_hash, status, installed_at, updated_at
SELECT app_id, app_name, version, open_url, manifest_hash, status, installed_at, updated_at
FROM installed_apps
ORDER BY app_name ASC
"""
@@ -173,22 +173,24 @@ class Repository:
app_name: str,
version: str,
manifest_hash: str | None,
open_url: str | None = None,
status: str = "installed",
) -> None:
now = utc_now()
with get_connection() as connection:
connection.execute(
"""
INSERT INTO installed_apps (app_id, app_name, version, manifest_hash, status, installed_at, updated_at)
VALUES (?, ?, ?, ?, ?, ?, ?)
INSERT INTO installed_apps (app_id, app_name, version, open_url, manifest_hash, status, installed_at, updated_at)
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
ON CONFLICT(app_id) DO UPDATE SET
app_name = excluded.app_name,
version = excluded.version,
open_url = excluded.open_url,
manifest_hash = excluded.manifest_hash,
status = excluded.status,
updated_at = excluded.updated_at
""",
(app_id, app_name, version, manifest_hash, status, now, now),
(app_id, app_name, version, open_url, manifest_hash, status, now, now),
)
def delete_installed_app(self, app_id: str) -> None:
@@ -252,4 +254,3 @@ class Repository:
def export_manifest_hash(self, manifest: dict[str, Any]) -> str:
return json.dumps(manifest, sort_keys=True, separators=(",", ":"))