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

feat(crowdinfiles): delete document if Crowdin API returns 404 #213

Merged

Conversation

thompsonsj
Copy link
Owner

@thompsonsj thompsonsj commented Oct 28, 2024

After #206, it's clear that in the scenario where files are deleted on Crowdin, plugin translation operations are slowed down as it attempts to retrieve deleted files receiving a 404 response from the Crowdin API for each one.

error CrowdinError: File Not Found
    at handleHttpClientError (/<app-dir>/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
    at /<app-dir>/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  code: 404
}

Delete the CrowdinFiles document if the Crowdin API indicates that the file does not exist. Include a flag in config to disable this behaviour in case things start going wrong (also a useful flag anyway in case users of the plugin prefer to keep a record of all Crowdin files created)!

Includes some type fixes.

Copy link

nx-cloud bot commented Oct 28, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 0996152. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@thompsonsj thompsonsj merged commit 3976a33 into main Oct 28, 2024
2 checks passed
@thompsonsj thompsonsj mentioned this pull request Oct 28, 2024
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.

1 participant