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

[Zendesk] Add the brandId in the internal IDs for tickets and articles #9691

Closed
aubin-tchoi opened this issue Jan 2, 2025 · 5 comments
Closed
Assignees

Comments

@aubin-tchoi
Copy link
Contributor

aubin-tchoi commented Jan 2, 2025

  • An assumption was made in the code that the ticketIds and articleIds were unique within a connector.
  • This turns out to not be the case as multiple brands will have clashing IDs.
  • As a result, the internal ID of an article or a ticket has to contain the brandId.

Proposed course of actions:
- Start inserting document_id x2 (with and without the brandId) in connectors.
- Force resync all the Zendesk connectors.
- Update connectors to use the new IDs in contentNode (fixes https://github.com/dust-tt/tasks/issues/1870).
- Update connectors to only upsert the new IDs.
- Delete all documents using old IDs.

Updated course of actions:

  • Start inserting the new document_id (with the brandId) and deletes the documents using the old ones (without the brandId) in connectors.
  • Force resync all the Zendesk connectors.
  • Update connectors to use the new IDs in contentNode.
  • Fix the db fetch to use the brandId + ticketId/articleId/categoryId (fixes https://github.com/dust-tt/tasks/issues/1870).
  • Delete all documents using old IDs if any remaining.

Note: no migration required on front, the documents affected are never parents.

@aubin-tchoi
Copy link
Contributor Author

@spolu LGTY?

@spolu
Copy link
Contributor

spolu commented Jan 2, 2025

@aubin-tchoi LGTM

@aubin-tchoi
Copy link
Contributor Author

note: no single ticket or article in data_source_views

SELECT dsv.* 
FROM data_source_views dsv
JOIN data_sources ds ON ds.id = dsv."dataSourceId"
WHERE ds."connectorProvider" = 'zendesk';

same goes for agent_data_source_configurations

SELECT dsv.* 
FROM agent_data_source_configurations dsv
JOIN data_sources ds ON ds.id = dsv."dataSourceId"
WHERE ds."connectorProvider" = 'zendesk';

@spolu
Copy link
Contributor

spolu commented Jan 2, 2025

Good to know 👍

@aubin-tchoi
Copy link
Contributor Author

Closing this as it was handled in #9723 and a check on the db select document_id from data_sources_documents where document_id similar to 'zendesk-ticket-\d+'; shows that all tickets have been migrated

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 a pull request may close this issue.

2 participants