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

Handle directories/files deleted on Crowdin #147

Open
thompsonsj opened this issue Dec 23, 2023 · 2 comments
Open

Handle directories/files deleted on Crowdin #147

thompsonsj opened this issue Dec 23, 2023 · 2 comments

Comments

@thompsonsj
Copy link
Owner

If a collection directory is deleted on Crowdin, and a corresponding CrowdinArticleDirectories collection document exists for that directory, the following line will cause an error:

directoryId: crowdinPayloadCollectionDirectory['originalId'] as number,

Error: Invalid directory id given. Directory doesn't exists
    at handleHttpClientError (/<project-dir>/node_modules/@crowdin/crowdin-api-client/out/core/index.js:79:15)
    at /<project-dir>/node_modules/@crowdin/crowdin-api-client/out/core/index.js:250:29
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Handle this type of scenario. Might be worth doing this once the plugin has been refactored to only use nock rather than a mock API.

@thompsonsj
Copy link
Owner Author

Another scenario - a file deleted on Crowdin:

[2024-08-14T08:54:50] | CrowdinError: File Not Found
-- | --
[2024-08-14T08:54:50] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-08-14T08:54:50] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-08-14T08:54:50] | at runMicrotasks (<anonymous>)
[2024-08-14T08:54:50] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-08-14T08:54:50] | code: 404
[2024-08-14T08:54:50] | }

No context is given. It would be useful if we detected this scenario in the UI and reported on which file could not be found - presenting an option to recreate it?

@thompsonsj
Copy link
Owner Author

In a scenario where a lot of fields were deleted on Crowdin (it's assumed they were created as a result of duplicated documents, see #201), the following large number of errors occured.

The document updated all the same but the CMS indicates there was a problem.


[2024-10-22T10:50:07] | CrowdinError: File Not Found
-- | --
[2024-10-22T10:50:07] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:07] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:07] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:07] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:07] | code: 404
[2024-10-22T10:50:07] | }
[2024-10-22T10:50:09] | CrowdinError: File Not Found
[2024-10-22T10:50:09] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:09] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:09] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:09] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:09] | code: 404
[2024-10-22T10:50:09] | }
[2024-10-22T10:50:11] | CrowdinError: File Not Found
[2024-10-22T10:50:11] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:11] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:11] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:11] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:11] | code: 404
[2024-10-22T10:50:11] | }
[2024-10-22T10:50:14] | CrowdinError: File Not Found
[2024-10-22T10:50:14] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:14] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:14] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:14] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:14] | code: 404
[2024-10-22T10:50:14] | }
[2024-10-22T10:50:17] | CrowdinError: File Not Found
[2024-10-22T10:50:17] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:17] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:17] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:17] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:17] | code: 404
[2024-10-22T10:50:17] | }
[2024-10-22T10:50:18] | CrowdinError: File Not Found
[2024-10-22T10:50:18] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:18] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:18] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:18] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:18] | code: 404
[2024-10-22T10:50:18] | }
[2024-10-22T10:50:27] | CrowdinError: File Not Found
[2024-10-22T10:50:27] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:27] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:27] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:27] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:27] | code: 404
[2024-10-22T10:50:27] | }
[2024-10-22T10:50:29] | CrowdinError: File Not Found
[2024-10-22T10:50:29] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:29] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:29] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:29] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:29] | code: 404
[2024-10-22T10:50:29] | }
[2024-10-22T10:50:35] | CrowdinError: File Not Found
[2024-10-22T10:50:35] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:35] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:35] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:35] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:35] | code: 404
[2024-10-22T10:50:35] | }
[2024-10-22T10:50:36] | CrowdinError: File Not Found
[2024-10-22T10:50:36] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:36] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:36] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:36] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:36] | code: 404
[2024-10-22T10:50:36] | }
[2024-10-22T10:50:37] | CrowdinError: File Not Found
[2024-10-22T10:50:37] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:37] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:37] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:37] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:37] | code: 404
[2024-10-22T10:50:37] | }
[2024-10-22T10:50:37] | CrowdinError: File Not Found
[2024-10-22T10:50:37] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:37] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:37] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:37] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:37] | code: 404
[2024-10-22T10:50:37] | }
[2024-10-22T10:50:38] | CrowdinError: File Not Found
[2024-10-22T10:50:38] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:38] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:38] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:38] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:38] | code: 404
[2024-10-22T10:50:38] | }
[2024-10-22T10:50:38] | CrowdinError: File Not Found
[2024-10-22T10:50:38] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:38] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:38] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:38] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:38] | code: 404
[2024-10-22T10:50:38] | }
[2024-10-22T10:50:39] | CrowdinError: File Not Found
[2024-10-22T10:50:39] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:39] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:39] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:39] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:39] | code: 404
[2024-10-22T10:50:39] | }
[2024-10-22T10:50:39] | CrowdinError: File Not Found
[2024-10-22T10:50:39] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:39] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:39] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:39] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:39] | code: 404
[2024-10-22T10:50:39] | }
[2024-10-22T10:50:40] | CrowdinError: File Not Found
[2024-10-22T10:50:40] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:40] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:40] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:40] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:40] | code: 404
[2024-10-22T10:50:40] | }
[2024-10-22T10:50:41] | CrowdinError: File Not Found
[2024-10-22T10:50:41] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:41] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:41] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:41] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:41] | code: 404
[2024-10-22T10:50:41] | }
[2024-10-22T10:50:41] | CrowdinError: File Not Found
[2024-10-22T10:50:41] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:41] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:41] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:41] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:41] | code: 404
[2024-10-22T10:50:41] | }
[2024-10-22T10:50:42] | CrowdinError: File Not Found
[2024-10-22T10:50:42] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:42] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:42] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:42] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:42] | code: 404
[2024-10-22T10:50:42] | }
[2024-10-22T10:50:42] | CrowdinError: File Not Found
[2024-10-22T10:50:42] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:42] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:42] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:42] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:42] | code: 404
[2024-10-22T10:50:42] | }
[2024-10-22T10:50:43] | CrowdinError: File Not Found
[2024-10-22T10:50:43] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:43] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:43] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:43] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:43] | code: 404
[2024-10-22T10:50:43] | }
[2024-10-22T10:50:43] | CrowdinError: File Not Found
[2024-10-22T10:50:43] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:43] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:43] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:43] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:43] | code: 404
[2024-10-22T10:50:43] | }
[2024-10-22T10:50:44] | CrowdinError: File Not Found
[2024-10-22T10:50:44] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:44] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:44] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:44] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:44] | code: 404
[2024-10-22T10:50:44] | }
[2024-10-22T10:50:46] | CrowdinError: File Not Found
[2024-10-22T10:50:46] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:46] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:46] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:46] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:46] | code: 404
[2024-10-22T10:50:46] | }
[2024-10-22T10:50:47] | CrowdinError: File Not Found
[2024-10-22T10:50:47] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:47] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:47] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:47] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:47] | code: 404
[2024-10-22T10:50:47] | }
[2024-10-22T10:50:48] | CrowdinError: File Not Found
[2024-10-22T10:50:48] | at handleHttpClientError (/workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:82:15)
[2024-10-22T10:50:48] | at /workspace/node_modules/@crowdin/crowdin-api-client/out/core/index.js:254:29
[2024-10-22T10:50:48] | at runMicrotasks (<anonymous>)
[2024-10-22T10:50:48] | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[2024-10-22T10:50:48] | code: 404
[2024-10-22T10:50:48] | }


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

No branches or pull requests

1 participant