Skip to content

Update the firestore logs with the tasks number #74

@bidoubiwa

Description

@bidoubiwa

When an action is triggered on Meilisearch (update/create/delete document), on Meilisearch side a task is created and added in a queue.
To monitor this specific task using the task API the user must know the task uid.

Since we do not provide that number in the logs, the user has to look at all the tasks to find the one they try to monitor.
To avoid this unnecessary search, we should add the task number in the logs.

Example:
In this code:

if (validateDocumentId(documentId)) {
const document = adaptDocument(documentId, snapshot)
await index.addDocuments([document], { primaryKey: '_firestore_id' })
} else {
logger.error(

We can change the code the following way:

const { taskUid } = await index.addDocuments([document], {
        primaryKey: '_firestore_id',
      })
logger.info(`The task number of the document addition is: ${taskUid}`)

Not sure about the logging message, tell me if you have a better idea.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions