Conversion from docx to text randomly dails

We have just rolled a product where we translate documents from DOCX to text.
The documents are in Arabic or Chinese.

Now, in production, the conversion often results in an empty text.
It seems to happen randomly - the same document is sometimes converted successfully, and sometimes it returns an empty text.
No error is returned - status code always indicates success, so there is nothing that could help with debugging.

Last time it happened at 2024-12-19T09:37:15 UTC

@ProSyn

Can you please provide more details about the method you are using for the conversion and any specific settings or parameters you are applying during the process?

We are node. The relevant code:

export async function convertDocumentToText(document: Buffer): Promise<string> {


    const stream = Readable.from(document);

    const request = new ConvertDocumentRequest({
        document: stream,
        format: "txt"
    });

    const convertResult = await wordsApi.convertDocument(request);

    if (convertResult.response.statusCode !== 200) {
        console.error(convertResult.response.statusMessage);
        throw new Error("Error converting document");
    }

    return convertResult.body.toString();

}

Sorry for the inconvenience; please share the document converted with issues.

Uploading the document

jin26_English.docx (21.0 KB)

Thank you for sharing the document. I did a few conversions, and all are okay, so I need to go into a deeper analysis.