This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Description
Version: 1.0.11-alpha.0
We have a project with three languages (en as default, nl and fr). After we approved a new label and downloading the files with the following code:
for (const language of ['en','nl','fr']) {
const contents = await api.getFileContents({
projectId: ourProjectId,
fileId: fileId,
lang: language,
});
const json = await contents.text();
}
The first two requests always return an empty json object {}. The third request will have the labels.
I noticed that adding a timeout between the requests helps, as the second request will already have the labels as one. Switching the order of the requested languages doesn't make a change.
I think that the getFileContents notices that the files are outdated and returns an empty json object while generating the new files. If these updated files are ready by the time the other requests come in, they'll receive the correct, updated contents.
I haven't tested if this is the same when calling the HTTP endpoints directly instead of through this package.