From 99b73da2b1dcef7272e22f0826949267e35cdf2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20S=C3=A1?= Date: Fri, 29 Apr 2022 16:25:45 +0100 Subject: [PATCH] docs: update the T&C resolver comment --- lib/graphql/resolvers.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/graphql/resolvers.js b/lib/graphql/resolvers.js index ee1538f4..f5e4fc7d 100644 --- a/lib/graphql/resolvers.js +++ b/lib/graphql/resolvers.js @@ -240,9 +240,18 @@ const massageTerms = terms => (terms.active && terms.text) ? ({ * Just (Just hash, Nothing) => Nothing * May happen (after `massageTerms`) if T&C are disabled. * - * Just (Just hash, Just tc) => Just (hash, Just tc) or Just (hash, Nothing) - * `tc` is sent depending on whether the `hash` differs from `currentHash` or - * not. + * Just (Just hash, Just tc) => Just (hash, Nothing, Nothing) + * If both the `hash` and the `configVersion` are the same as `currentHash` + * and `currentConfigVersion`, respectively, then there's no need to send + * `text` nor `details`. + * + * Just (Just hash, Just tc) => Just (hash, Nothing, Just details) + * If `configVersion` differs from `currentConfigVersion` but the `hash` is + * the same, then only the details have to be updated. + * + * Just (Just hash, Just tc) => Just (hash, Just text, Just details) + * If the `hash` differs from `currentHash` then everything is resent (to + * simplify machine implementation). */ const terms = (parent, { currentConfigVersion, currentHash }, { deviceId, settings }, info) => { const isNone = x => _.isNil(x) || _.isEmpty(x)