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

File contents empty after approving new label #6

@dumazy

Description

@dumazy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions