Skip to content

Comments

SQSERVICES-1169 New internal endpoint to configure the guest links team feature#1993

Merged
battermann merged 5 commits intodevelopfrom
SQSERVICE-1169-internal-endpoint-to-configure-guest-links-feature
Dec 17, 2021
Merged

SQSERVICES-1169 New internal endpoint to configure the guest links team feature#1993
battermann merged 5 commits intodevelopfrom
SQSERVICE-1169-internal-endpoint-to-configure-guest-links-feature

Conversation

@battermann
Copy link
Contributor

@battermann battermann commented Dec 14, 2021

https://wearezeta.atlassian.net/browse/SQSERVICES-1169

Checklist

  • The PR Title explains the impact of the change.
  • The PR description provides context as to why the change should occur and what the code contributes to that effect. This could also be a link to a JIRA ticket or a Github issue, if there is one.
  • If HTTP endpoint paths have been added or renamed, the endpoint / config-flag checklist (see Wire-employee only backend wiki page) has been followed.
  • changelog.d contains the following bits of information (details):
    • A file with the changelog entry in one or more suitable sub-sections. The sub-sections are marked by directories inside changelog.d.

@battermann battermann requested a review from fisx December 14, 2021 14:49
@battermann battermann force-pushed the SQSERVICE-1169-internal-endpoint-to-configure-guest-links-feature branch from d22ad4e to c495217 Compare December 14, 2021 15:39
import Data.Qualified
import Data.String.Conversions (cs)
import Data.Time.Clock
import Debug.Trace
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not allowed in prod code. (we really should have hlint checking these things...) if there is some logging you want to do, use tinylog, but I suspect it should just go away?

Comment on lines 635 to 648
getGuestLinkInternal = \case
Left _ -> getCfgDefault
Left _ -> do
traceM "internal param user"
getCfgDefault
Right tid -> do
cfgDefault <- getCfgDefault
let defLockStatus = Public.tfwoapsLockStatus cfgDefault
maybeFeatureStatus <- TeamFeatures.getFeatureStatusNoConfig @'Public.TeamFeatureGuestLinks tid
pure $ case (defLockStatus, maybeFeatureStatus) of
(Public.Unlocked, Just featureStatus) ->
pure $ case maybeFeatureStatus of
Just featureStatus ->
Public.TeamFeatureStatusNoConfigAndLockStatus
(Public.tfwoStatus featureStatus)
Public.Unlocked
(Public.Unlocked, Nothing) -> cfgDefault {Public.tfwoapsLockStatus = Public.Unlocked}
(Public.Locked, _) -> cfgDefault {Public.tfwoapsLockStatus = Public.Locked}
defLockStatus
Nothing -> cfgDefault
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a genuine fix, but it's still not completely correct. Shouldn't the lock status in L647 come from cassandra, not the default?

(Wow, this is complicated, though. Why is this so complicated?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(And have we been making the same mistake elsewhere?)

@battermann battermann changed the title SQSERVICES-1160 New internal endpoint to configure the guest links team feature SQSERVICES-1169 New internal endpoint to configure the guest links team feature Dec 17, 2021
@battermann battermann force-pushed the SQSERVICE-1169-internal-endpoint-to-configure-guest-links-feature branch from c495217 to bdfc36f Compare December 17, 2021 12:23
@battermann battermann requested a review from fisx December 17, 2021 12:26
Copy link
Contributor

@fisx fisx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

close! :)

migration = Migration 57 "Add lock status for guest links team feature" $ do
schema'
[r| ALTER TABLE team_features ADD (
guest_links_lock_status int
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be consistent with the symbol?

type KnownTeamFeatureNameSymbol 'TeamFeatureGuestLinks = "conversationGuestLinks"

@battermann battermann requested a review from fisx December 17, 2021 13:08
@battermann battermann merged commit 6cff0a9 into develop Dec 17, 2021
@battermann battermann deleted the SQSERVICE-1169-internal-endpoint-to-configure-guest-links-feature branch December 17, 2021 16:24
@akshaymankar akshaymankar mentioned this pull request Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants