Repository navigation
Include customer conversations in the Gladly SUMMARIZE summary - #11
Open
eastagile-tracker wants to merge 1 commit into
Open
eastagile-tracker wants to merge 1 commit into
eastagile-tracker wants to merge 1 commit into
Conversation
summarizeData only fetched customer profiles, so the summary attached to the Osano action item never contained the requester's conversations even though the README describes SUMMARIZE as retrieving profiles and conversations. Fetch each profile's conversations and nest them under the profile in the summary.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR proposes including customer conversations in the Gladly SUMMARIZE summary, as the sample's README describes. We include this PR work along with a full history of your repo at https://eastagiletracker.com/projects/1451. You can sign in with your GitHub ID to claim ownership of the project.
What changed and why
The Gladly sample's README says SUMMARIZE "retrieves customer profiles and conversations from Gladly and attaches a summary to the Osano action item", but
summarizeData()inservices/integration.jsonly callsgetCustomerProfiles(). The conversations endpoint is never requested, so the summary attached to a subject-access request contains the profile records alone and silently leaves out the requester's support conversations. Since this sample is the reference that customers copy into their own Lambda, that gap carries straight into their access responses.The fix fetches each profile's conversations with the existing
getConversations()client (the same call the DELETE path already uses) and nests them under the profile, so the summary is still an array of profiles, each now carrying aconversationsarray. BecausegetConversations()already throws onGladly-Limited-Data: true, a customer with more conversations than Gladly returns fails the request for manual processing instead of getting a partial summary, which matches how DELETE behaves.Reproduction on current
main(abf5dd7): callingindex.handlerwith a SUMMARIZE payload andfetchstubbed to return one profile with one conversation produces these outbound requests and summary:With this change the same run adds
GET .../v1/customers/cust-1/conversationsand attaches[{"id":"cust-1",...,"conversations":[{"id":"conv-1","status":"CLOSED"}]}].Verification:
npx jestinsample-gladly-webhook-integrationwas 25/25 passing before the change and is 26/26 after, with no new failures. The updated summarize test asserts conversations are fetched for every profile and included in the attached summary, and a new test checks that when conversations cannot be retrieved nothing is attached and the action item is not marked completed. Both fail againstmainand pass with the fix. The existing no-profiles test is unchanged and still passes.How this was managed
This work was tracked as https://eastagiletracker.com/projects/1451/stories/1555051 on https://eastagiletracker.com/projects/1451, a board imported from this repo's pull requests (10 stories) and used to manage this change.
If you'd rather not receive contributions like this, reply
no-more-prson this pull request and we won't open any further ones on your repositories.Lawrence W. Sinclair
CEO / East Agile
linkedin.com/in/lwsinclair/
eastagile.com