From 3a9412cafd29032617373d3c2bec4f012a8ea1dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Tue, 2 Apr 2024 09:04:10 +0200 Subject: [PATCH] Use unique app spec version (#2535) The ID is currently preserved on new deployments. Therefore we also consider the sha and the timestamp. --- lib/livebook/hubs/team.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/livebook/hubs/team.ex b/lib/livebook/hubs/team.ex index 23c2cf140..553812f4d 100644 --- a/lib/livebook/hubs/team.ex +++ b/lib/livebook/hubs/team.ex @@ -265,9 +265,11 @@ defimpl Livebook.Hubs.Provider, for: Livebook.Hubs.Team do app_deployments = TeamClient.get_agent_app_deployments(team.id) for app_deployment <- app_deployments do + {seconds, _} = NaiveDateTime.to_gregorian_seconds(app_deployment.deployed_at) + %Livebook.Apps.TeamsAppSpec{ slug: app_deployment.slug, - version: app_deployment.id, + version: "#{app_deployment.id}-#{seconds}-#{app_deployment.sha}", hub_id: team.id, app_deployment_id: app_deployment.id }