From e24fa1e17c71c3be5fae44a0752fe20a29e0b872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sat, 7 Oct 2023 22:21:24 +0200 Subject: [PATCH] Clarify code comments --- lib/livebook/live_markdown/import.ex | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/livebook/live_markdown/import.ex b/lib/livebook/live_markdown/import.ex index 87d4ab6d4..a12e71d3a 100644 --- a/lib/livebook/live_markdown/import.ex +++ b/lib/livebook/live_markdown/import.ex @@ -633,8 +633,11 @@ defmodule Livebook.LiveMarkdown.Import do {false, notebook, [@invalid_stamp_message <> extra]} end - # We enable teams features for offline hub only if the stamp - # is valid, which ensures it is an existing Teams hub + # If the hub is online, then by definition it is a valid hub, + # so we enable team features. If the hub is offline, then + # we can only enable team features if the stamp is valid + # (which means the server signed with a private key and we + # validate it against the public key). teams_enabled = is_struct(hub, Livebook.Hubs.Team) and (hub.offline == nil or valid_stamp?) {%{notebook | teams_enabled: teams_enabled}, messages}