Skip to content

Commit

Permalink
WPB-15072 team activated is not sent to ibis when a personal user cre…
Browse files Browse the repository at this point in the history
…ates a new team (#4380)
  • Loading branch information
battermann authored Dec 17, 2024
1 parent 5a260a0 commit 0a966e1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/3-bug-fixes/WPB-15072
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Send team active event in personal user to team flow
5 changes: 5 additions & 0 deletions integration/test/API/GalleyInternal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,8 @@ patchTeamFeature domain team featureName payload = do
tid <- asString team
req <- baseRequest domain Galley Unversioned $ joinHttpPath ["i", "teams", tid, "features", featureName]
submit "PATCH" $ req & addJSON payload

getTeam :: (HasCallStack, MakesValue domain) => domain -> String -> App Response
getTeam domain tid = do
req <- baseRequest domain Galley Unversioned $ joinHttpPath ["i", "teams", tid]
submit "GET" $ req
8 changes: 6 additions & 2 deletions integration/test/Test/Teams.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import API.Brig
import qualified API.BrigInternal as I
import API.Common
import API.Galley (getTeam, getTeamMembers, getTeamMembersCsv, getTeamNotifications)
import API.GalleyInternal (setTeamFeatureStatus)
import qualified API.GalleyInternal as I
import API.Gundeck
import qualified API.Nginz as Nginz
import Control.Monad.Codensity (Codensity (runCodensity))
Expand Down Expand Up @@ -58,7 +58,7 @@ testInvitePersonalUserToTeam = do
resp.json %. "invitations" `shouldMatch` ([] :: [()])

ownerId <- owner %. "id" & asString
setTeamFeatureStatus domain tid "exposeInvitationURLsToTeamAdmin" "enabled" >>= assertSuccess
I.setTeamFeatureStatus domain tid "exposeInvitationURLsToTeamAdmin" "enabled" >>= assertSuccess
user <- I.createUser domain def >>= getJSON 201
uid <- user %. "id" >>= asString
email <- user %. "email" >>= asString
Expand Down Expand Up @@ -289,6 +289,10 @@ testUpgradePersonalToTeam = do
team <- getTeam alice tid >>= getJSON 200
team %. "name" `shouldMatch` teamName

iTeam <- asString tid >>= I.getTeam alice >>= getJSON 200
iTeam %. "team.name" `shouldMatch` teamName
iTeam %. "status" `shouldMatch` "active"

bindResponse (getTeamMembers alice tid) $ \resp -> do
resp.status `shouldMatchInt` 200
owner <- asList (resp.json %. "members") >>= assertOne
Expand Down
1 change: 1 addition & 0 deletions services/brig/src/Brig/API/User.hs
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ upgradePersonalToTeam luid bNewTeam = do
liftSem $ GalleyAPIAccess.createTeam uid (bnuTeam bNewTeam) tid
let newTeam = bNewTeam.bnuTeam
pure $ CreateUserTeam tid (fromRange newTeam.newTeamName)
liftSem $ GalleyAPIAccess.changeTeamStatus tid Team.Active bNewTeam.bnuCurrency

liftSem $ updateUserTeam uid tid
liftSem $ User.internalUpdateSearchIndex uid
Expand Down

0 comments on commit 0a966e1

Please sign in to comment.