Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(zendesk): only fetch comment authors #8935

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

fontanierh
Copy link
Contributor

Description

We were trying to fetch all users in the workspace every single time, which was taking a very long time (never really completing from what I can tell)

With this change, we're only fetching the users that commented on the tickets, which is usually very quick.

Risk

N/A

Deploy Plan

Deploy connectors and resume the connectors

Comment on lines +442 to +445
const userIds = _.uniq(
_.flatten(comments2d.map((comments) => comments.map((c) => c.author_id)))
);
const { result: users } = await zendeskApiClient.users.showMany(userIds);
Copy link
Contributor

Choose a reason for hiding this comment

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

wow I hate this lol

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whic part :p ?

Copy link
Contributor

Choose a reason for hiding this comment

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

i so deeply hate Lodash it's crazy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why ? it's pretty convenient.

WIthout lodash you'd need to do:

Array.from(new Set(comments2d.map((comments) => comments.map((c) => c.author_id)).flat()))

which in my opinion is less readable:

  • array.from + set is longer
  • mixing fn(...) with obj.meth(...) syntaxes on one line makes it harder to understand

debatable ofc, but we have lodash so we might as well use it

Copy link
Contributor

Choose a reason for hiding this comment

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

I would personally do const userIds = [...new Set(comments2d.flatMap(comments => comments.map(c => c.author_id)))];

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that's not bad !

Copy link
Contributor

Choose a reason for hiding this comment

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

matter of personal taste to me, I don't see lodash as smth cool kids do :p

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't see javascript as something the cool kids do

Copy link
Contributor

Choose a reason for hiding this comment

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

true lol

Copy link
Contributor

Choose a reason for hiding this comment

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

thank god we do rust

@aubin-tchoi
Copy link
Contributor

LGTM 🙏

@fontanierh fontanierh merged commit ab30fa5 into main Nov 27, 2024
3 checks passed
@fontanierh fontanierh deleted the fix/zendesk-only-fetch-commenters branch November 27, 2024 10:22
albandum added a commit that referenced this pull request Nov 27, 2024
commit 9adde25
Author: Alban Dumouilla <[email protected]>
Date:   Wed Nov 27 17:14:01 2024 +0100

    AgentMessageFeedbacks API (#8879)

    * Feedbacks backend

    * Update sparkle

    * Update package-lock.json

    * Use resource

    * Move bodyvalidation

    * Undo change

    * Add cascade on workspace and message deletion

    * Truncate index name

    * Add workspaceId FK

    * Add destroy feedbacks in workspace scrub

    * lint

    * Destroy agentmessagefeedback

    * Add SET NULL on users FK

    * Fix msg id

commit 04d68c9
Author: Henry Fontanier <[email protected]>
Date:   Wed Nov 27 16:38:04 2024 +0100

    feat(kw-search): pass title & mime when upserting tables from connectors (#8962)

    * feat(kw-search): pass title and mimetype when upserting tables from connectors

    * improve mimetype for notion DB

    ---------

    Co-authored-by: Henry Fontanier <[email protected]>

commit 551d655
Author: Henry Fontanier <[email protected]>
Date:   Wed Nov 27 16:33:01 2024 +0100

    fix(kw-search): delete datasource node then delete table (#8964)

    Co-authored-by: Henry Fontanier <[email protected]>

commit 6478c3e
Author: Thomas Draier <[email protected]>
Date:   Wed Nov 27 16:30:52 2024 +0100

    [core]  Add folders endpoint (#8957)

    * folders endpoint

    * fixes

commit e4eee59
Author: Alban Dumouilla <[email protected]>
Date:   Wed Nov 27 16:28:44 2024 +0100

    Revamping the extension whitelist (#8949)

    * Revamping the extension whitelist

    * Remove svg and sourcemaps

    * Remove csv/xml

    * Removing tfvars and tfstate to avoid syncing PII

commit 44b6316
Author: Sebastien Flory <[email protected]>
Date:   Wed Nov 27 16:04:00 2024 +0100

    Fix: counter-intuitive return values (#8961)

commit 9a25d2d
Author: Henry Fontanier <[email protected]>
Date:   Wed Nov 27 15:56:40 2024 +0100

    fix: upsert table before upserting datasource node (#8959)

    Co-authored-by: Henry Fontanier <[email protected]>

commit 591fe88
Author: Henry Fontanier <[email protected]>
Date:   Wed Nov 27 15:55:35 2024 +0100

    feat(kw-search): allow passible title and mimetype on front endpoints when upserting tables (#8955)

    Co-authored-by: Henry Fontanier <[email protected]>

commit 66d3d53
Author: Sebastien Flory <[email protected]>
Date:   Wed Nov 27 15:52:54 2024 +0100

    Use if/else to avoid complex operators (#8960)

commit 3e95e5c
Author: Sebastien Flory <[email protected]>
Date:   Wed Nov 27 15:47:46 2024 +0100

    Fix: exit 0 in case not blocked, pass correct component name (#8958)

commit 6a9a3b6
Author: Sebastien Flory <[email protected]>
Date:   Wed Nov 27 15:35:54 2024 +0100

    Fix: confusing operators of bash (#8956)

commit 5a84b75
Author: Daphné Popin <[email protected]>
Date:   Wed Nov 27 15:31:10 2024 +0100

    Bump ext (#8954)

commit 529fd50
Author: Sebastien Flory <[email protected]>
Date:   Wed Nov 27 15:22:18 2024 +0100

    Strip the cc part (#8953)

commit 6637b13
Author: Sebastien Flory <[email protected]>
Date:   Wed Nov 27 15:18:52 2024 +0100

    Escape the topic (#8952)

commit 8e5e0ca
Author: Thomas Draier <[email protected]>
Date:   Wed Nov 27 15:07:17 2024 +0100

    [extension] Better error handling in screen capture (#8944)

    * Better error handling

    * Update extension/app/background.ts

    Co-authored-by: Daphné Popin <[email protected]>

    * Update extension/app/background.ts

    Co-authored-by: Daphné Popin <[email protected]>

    * Update extension/app/background.ts

    Co-authored-by: Daphné Popin <[email protected]>

    * format

    ---------

    Co-authored-by: Daphné Popin <[email protected]>

commit ecc53d6
Author: Sebastien Flory <[email protected]>
Date:   Wed Nov 27 15:06:39 2024 +0100

    Remaining useless inputs (#8951)

    * Remaining useless inputs

    * Add: error to debug

commit 4fe7961
Author: Sebastien Flory <[email protected]>
Date:   Wed Nov 27 14:57:52 2024 +0100

    Fix: action order (#8950)

commit 113600a
Author: Aubin <[email protected]>
Date:   Wed Nov 27 14:57:42 2024 +0100

    :recycle: remove an unused startFromTs parameter (#8947)

commit cc11e95
Author: Henry Fontanier <[email protected]>
Date:   Wed Nov 27 14:52:18 2024 +0100

    feat(kw-search): create ds node for tables in core (#8945)

    * feat(kw-search): create ds node for tables in core

    * also delete ds node

    ---------

    Co-authored-by: Henry Fontanier <[email protected]>

commit 11dca3c
Author: Sebastien Flory <[email protected]>
Date:   Wed Nov 27 14:51:34 2024 +0100

    Add: github action to prevent deployment based on channel topic (#8948)

commit 9fd096c
Author: Stanislas Polu <[email protected]>
Date:   Wed Nov 27 14:50:18 2024 +0100

    ActionsDetails: finer grained action state (#8940)

    * ActionsDetails: finer grained action state

    * nit

    * memoize the spinner

    * nit/comment

    * tweak

commit 3cadd72
Author: Daphné Popin <[email protected]>
Date:   Wed Nov 27 14:18:04 2024 +0100

    Extension default shortcut to open panel (#8942)

commit 68abb7c
Author: Sebastien Flory <[email protected]>
Date:   Wed Nov 27 13:12:56 2024 +0100

    Add: dropdown to show all assistants used by a datasource and show modal on click (#8932)

    * Add: dropdown to show all assistants used by a datasource and show modal when click

    * Review fdbk

commit aca995d
Author: Daphné Popin <[email protected]>
Date:   Wed Nov 27 12:11:56 2024 +0100

    Ext: various polish (#8941)

commit 00eb9fc
Author: Aubin <[email protected]>
Date:   Wed Nov 27 12:01:53 2024 +0100

    [connectors] enh(Zendesk) Fix misleading comments (#8939)

    * ♻️

    * remove a misleading comment

    * 📝

    * 📝

commit 51bde1a
Author: Sebastien Flory <[email protected]>
Date:   Wed Nov 27 11:56:16 2024 +0100

    Relax columns count when uploading csv (#8934)

    * Relax columns count when uploading csv

    * Fix: missing correct handling for the other csv content type

commit 8d80e5f
Author: Philippe Rolet <[email protected]>
Date:   Wed Nov 27 11:46:41 2024 +0100

    [Favorites] Disable button while updating (#8936)

    * [Favorites] Disable button while updating

    Description
    ---
    Fixes #8933

    Risks
    ---
    na

    Deploy
    ---
    front

    * hover full

    * better hover handling

commit b86178d
Author: Daphné Popin <[email protected]>
Date:   Wed Nov 27 11:38:17 2024 +0100

    Ext: Various polish (#8937)

commit ab30fa5
Author: Henry Fontanier <[email protected]>
Date:   Wed Nov 27 11:22:15 2024 +0100

    fix(zendesk): only fetch comment authors (#8935)

    Co-authored-by: Henry Fontanier <[email protected]>

commit b0af32e
Author: Daphné Popin <[email protected]>
Date:   Wed Nov 27 10:25:07 2024 +0100

    Ext: polish dropdown convo list (#8930)

    * Ext: polish dropdown convo list

    * Fix padding input bar

commit 58e8f0b
Author: Henry Fontanier <[email protected]>
Date:   Wed Nov 27 10:24:08 2024 +0100

    enh: improve viz prompt (#8929)

    Co-authored-by: Henry Fontanier <[email protected]>

commit 39d60fa
Author: Jules Belveze <[email protected]>
Date:   Wed Nov 27 10:23:27 2024 +0100

    [.github] - fix: trim trailing whitespace in workflow file (#8931)

    - Removed trailing spaces from k8s cloud build script arguments to avoid potential syntax issues in YAML

commit 5380762
Author: Thomas Draier <[email protected]>
Date:   Wed Nov 27 10:19:33 2024 +0100

    [extension] Explicit file names (#8927)
overmode pushed a commit that referenced this pull request Nov 27, 2024
albandum added a commit that referenced this pull request Nov 27, 2024
* Feedbacks backend

* Update sparkle

* Update package-lock.json

* Use resource

* Move bodyvalidation

* Undo change

* Add cascade on workspace and message deletion

* Truncate index name

* Add workspaceId FK

* Add destroy feedbacks in workspace scrub

* Add feedbacks in workspace_usage API

* Add fetchUser

* Return feedbacks correctly

* lint

* jules nit

* Squashed commit of the following:

commit 9adde25
Author: Alban Dumouilla <[email protected]>
Date:   Wed Nov 27 17:14:01 2024 +0100

    AgentMessageFeedbacks API (#8879)

    * Feedbacks backend

    * Update sparkle

    * Update package-lock.json

    * Use resource

    * Move bodyvalidation

    * Undo change

    * Add cascade on workspace and message deletion

    * Truncate index name

    * Add workspaceId FK

    * Add destroy feedbacks in workspace scrub

    * lint

    * Destroy agentmessagefeedback

    * Add SET NULL on users FK

    * Fix msg id

commit 04d68c9
Author: Henry Fontanier <[email protected]>
Date:   Wed Nov 27 16:38:04 2024 +0100

    feat(kw-search): pass title & mime when upserting tables from connectors (#8962)

    * feat(kw-search): pass title and mimetype when upserting tables from connectors

    * improve mimetype for notion DB

    ---------

    Co-authored-by: Henry Fontanier <[email protected]>

commit 551d655
Author: Henry Fontanier <[email protected]>
Date:   Wed Nov 27 16:33:01 2024 +0100

    fix(kw-search): delete datasource node then delete table (#8964)

    Co-authored-by: Henry Fontanier <[email protected]>

commit 6478c3e
Author: Thomas Draier <[email protected]>
Date:   Wed Nov 27 16:30:52 2024 +0100

    [core]  Add folders endpoint (#8957)

    * folders endpoint

    * fixes

commit e4eee59
Author: Alban Dumouilla <[email protected]>
Date:   Wed Nov 27 16:28:44 2024 +0100

    Revamping the extension whitelist (#8949)

    * Revamping the extension whitelist

    * Remove svg and sourcemaps

    * Remove csv/xml

    * Removing tfvars and tfstate to avoid syncing PII

commit 44b6316
Author: Sebastien Flory <[email protected]>
Date:   Wed Nov 27 16:04:00 2024 +0100

    Fix: counter-intuitive return values (#8961)

commit 9a25d2d
Author: Henry Fontanier <[email protected]>
Date:   Wed Nov 27 15:56:40 2024 +0100

    fix: upsert table before upserting datasource node (#8959)

    Co-authored-by: Henry Fontanier <[email protected]>

commit 591fe88
Author: Henry Fontanier <[email protected]>
Date:   Wed Nov 27 15:55:35 2024 +0100

    feat(kw-search): allow passible title and mimetype on front endpoints when upserting tables (#8955)

    Co-authored-by: Henry Fontanier <[email protected]>

commit 66d3d53
Author: Sebastien Flory <[email protected]>
Date:   Wed Nov 27 15:52:54 2024 +0100

    Use if/else to avoid complex operators (#8960)

commit 3e95e5c
Author: Sebastien Flory <[email protected]>
Date:   Wed Nov 27 15:47:46 2024 +0100

    Fix: exit 0 in case not blocked, pass correct component name (#8958)

commit 6a9a3b6
Author: Sebastien Flory <[email protected]>
Date:   Wed Nov 27 15:35:54 2024 +0100

    Fix: confusing operators of bash (#8956)

commit 5a84b75
Author: Daphné Popin <[email protected]>
Date:   Wed Nov 27 15:31:10 2024 +0100

    Bump ext (#8954)

commit 529fd50
Author: Sebastien Flory <[email protected]>
Date:   Wed Nov 27 15:22:18 2024 +0100

    Strip the cc part (#8953)

commit 6637b13
Author: Sebastien Flory <[email protected]>
Date:   Wed Nov 27 15:18:52 2024 +0100

    Escape the topic (#8952)

commit 8e5e0ca
Author: Thomas Draier <[email protected]>
Date:   Wed Nov 27 15:07:17 2024 +0100

    [extension] Better error handling in screen capture (#8944)

    * Better error handling

    * Update extension/app/background.ts

    Co-authored-by: Daphné Popin <[email protected]>

    * Update extension/app/background.ts

    Co-authored-by: Daphné Popin <[email protected]>

    * Update extension/app/background.ts

    Co-authored-by: Daphné Popin <[email protected]>

    * format

    ---------

    Co-authored-by: Daphné Popin <[email protected]>

commit ecc53d6
Author: Sebastien Flory <[email protected]>
Date:   Wed Nov 27 15:06:39 2024 +0100

    Remaining useless inputs (#8951)

    * Remaining useless inputs

    * Add: error to debug

commit 4fe7961
Author: Sebastien Flory <[email protected]>
Date:   Wed Nov 27 14:57:52 2024 +0100

    Fix: action order (#8950)

commit 113600a
Author: Aubin <[email protected]>
Date:   Wed Nov 27 14:57:42 2024 +0100

    :recycle: remove an unused startFromTs parameter (#8947)

commit cc11e95
Author: Henry Fontanier <[email protected]>
Date:   Wed Nov 27 14:52:18 2024 +0100

    feat(kw-search): create ds node for tables in core (#8945)

    * feat(kw-search): create ds node for tables in core

    * also delete ds node

    ---------

    Co-authored-by: Henry Fontanier <[email protected]>

commit 11dca3c
Author: Sebastien Flory <[email protected]>
Date:   Wed Nov 27 14:51:34 2024 +0100

    Add: github action to prevent deployment based on channel topic (#8948)

commit 9fd096c
Author: Stanislas Polu <[email protected]>
Date:   Wed Nov 27 14:50:18 2024 +0100

    ActionsDetails: finer grained action state (#8940)

    * ActionsDetails: finer grained action state

    * nit

    * memoize the spinner

    * nit/comment

    * tweak

commit 3cadd72
Author: Daphné Popin <[email protected]>
Date:   Wed Nov 27 14:18:04 2024 +0100

    Extension default shortcut to open panel (#8942)

commit 68abb7c
Author: Sebastien Flory <[email protected]>
Date:   Wed Nov 27 13:12:56 2024 +0100

    Add: dropdown to show all assistants used by a datasource and show modal on click (#8932)

    * Add: dropdown to show all assistants used by a datasource and show modal when click

    * Review fdbk

commit aca995d
Author: Daphné Popin <[email protected]>
Date:   Wed Nov 27 12:11:56 2024 +0100

    Ext: various polish (#8941)

commit 00eb9fc
Author: Aubin <[email protected]>
Date:   Wed Nov 27 12:01:53 2024 +0100

    [connectors] enh(Zendesk) Fix misleading comments (#8939)

    * ♻️

    * remove a misleading comment

    * 📝

    * 📝

commit 51bde1a
Author: Sebastien Flory <[email protected]>
Date:   Wed Nov 27 11:56:16 2024 +0100

    Relax columns count when uploading csv (#8934)

    * Relax columns count when uploading csv

    * Fix: missing correct handling for the other csv content type

commit 8d80e5f
Author: Philippe Rolet <[email protected]>
Date:   Wed Nov 27 11:46:41 2024 +0100

    [Favorites] Disable button while updating (#8936)

    * [Favorites] Disable button while updating

    Description
    ---
    Fixes #8933

    Risks
    ---
    na

    Deploy
    ---
    front

    * hover full

    * better hover handling

commit b86178d
Author: Daphné Popin <[email protected]>
Date:   Wed Nov 27 11:38:17 2024 +0100

    Ext: Various polish (#8937)

commit ab30fa5
Author: Henry Fontanier <[email protected]>
Date:   Wed Nov 27 11:22:15 2024 +0100

    fix(zendesk): only fetch comment authors (#8935)

    Co-authored-by: Henry Fontanier <[email protected]>

commit b0af32e
Author: Daphné Popin <[email protected]>
Date:   Wed Nov 27 10:25:07 2024 +0100

    Ext: polish dropdown convo list (#8930)

    * Ext: polish dropdown convo list

    * Fix padding input bar

commit 58e8f0b
Author: Henry Fontanier <[email protected]>
Date:   Wed Nov 27 10:24:08 2024 +0100

    enh: improve viz prompt (#8929)

    Co-authored-by: Henry Fontanier <[email protected]>

commit 39d60fa
Author: Jules Belveze <[email protected]>
Date:   Wed Nov 27 10:23:27 2024 +0100

    [.github] - fix: trim trailing whitespace in workflow file (#8931)

    - Removed trailing spaces from k8s cloud build script arguments to avoid potential syntax issues in YAML

commit 5380762
Author: Thomas Draier <[email protected]>
Date:   Wed Nov 27 10:19:33 2024 +0100

    [extension] Explicit file names (#8927)

* thumbs enum
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