Skip to content

[WPB-23765] Refresh ES index after app update, emit event.#5231

Merged
fisx merged 6 commits into
developfrom
WPB-23765-refresh-es-index-after-app-update_-emit-event
May 19, 2026
Merged

[WPB-23765] Refresh ES index after app update, emit event.#5231
fisx merged 6 commits into
developfrom
WPB-23765-refresh-es-index-after-app-update_-emit-event

Conversation

@fisx
Copy link
Copy Markdown
Contributor

@fisx fisx commented May 15, 2026

https://wearezeta.atlassian.net/browse/WPB-23765

updating apps did not refresh the user index and did not send the user-update event. this is now fixed.

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label May 15, 2026
@fisx fisx force-pushed the WPB-23765-refresh-es-index-after-app-update_-emit-event branch from c5e1b0a to 731954e Compare May 15, 2026 15:24
@fisx fisx marked this pull request as ready for review May 15, 2026 15:24
@fisx fisx requested review from a team as code owners May 15, 2026 15:24
Copy link
Copy Markdown
Contributor

@battermann battermann left a comment

Choose a reason for hiding this comment

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

Only 2 nit-picks

<$> (resp.json %. "user")
<*> (resp.json %. "user.id")

let Object appMetadata =
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this deconstruction necessary? If we remove it we do not have to reconstruct it later in line 247, maybe?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

do you mean 84cd1bc?

that doesn't work:

----- Apps.testPutApp FAIL (1.78 s; failed at 2026-05-19T07:02:30.674Z) -----
assertion failure:
Expected String but got Object:
{
    "accent_id": 0,
    "app": {
        "category": "other",
        "description": "default description"
    },
    "assets": [],
    "id": "9a4b14dd-d75b-4437-b0cc-85f931139f4c",
    "legalhold_status": "disabled",
    "name": "choppie",
    "picture": [],
    "qualified_id": {
        "domain": "example.com",
        "id": "9a4b14dd-d75b-4437-b0cc-85f931139f4c"
    },
    "searchable": true,
    "supported_protocols": [
        "mls"
    ],
    "team": "7542fed1-2d37-4bfe-b52f-ab22c154ef83",
    "type": "app"
}

call stack: 
1. assertFailure at test/Testlib/JSON.hs:345
     assertFailure msg'

2. assertFailureWithJSON at test/Testlib/JSON.hs:105
     v -> assertFailureWithJSON x ("String" `typeWasExpectedButGot` v)

3. asString at test/API/Brig.hs:1278
     appIdStr <- asString appId

4. putAppMetadata at test/Test/Apps.hs:245
     bindResponse (putAppMetadata tid owner app (Object appMetadata)) $ \resp -> do

but maybe you meant something else?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I mean something like this:

  let appMetadata =
        [aesonQQ|
        {
          "accent_id": 126,
          "assets": [
            {
              "key": "3-1-47de4580-ae51-4650-acbb-d10c028cb0ac",
          "description": "This is the best app ever."
        }|]

  withWebSockets [owner, regularMember, app] \[wsOwner, wsRegularMember, wsApp] -> do
    bindResponse (putAppMetadata tid owner appId appMetadata) $ \resp -> do
      resp.status `shouldMatchInt` 200

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ah, that makes a lot more sense... :-)

yeah, that might have worked, but i don't want to make another PR to change this, is that ok?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

all good, it's a nitty nitpick

Comment thread integration/test/Notifications.hs Outdated
@fisx fisx force-pushed the WPB-23765-refresh-es-index-after-app-update_-emit-event branch from e281b3e to 84cd1bc Compare May 18, 2026 12:17
This reverts commit 84cd1bc.
@fisx fisx merged commit 2b88586 into develop May 19, 2026
10 checks passed
@fisx fisx deleted the WPB-23765-refresh-es-index-after-app-update_-emit-event branch May 19, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants