opral / inlang-message-sdk

0 stars 0 forks source link

Message-Query sometimes returns `undefined` instead of a message array #16

Open LorisSigrist opened 2 months ago

LorisSigrist commented 2 months ago

Context/Problem

project.query.message.getAll() sometimes returns undefined instead of a message array. This isn't reflected in the types.

The most likely cause is that the messages get queried before they are properly loaded & thus the query returns an uninitialized value.

This caused PARJS-57

Proposal

Either block until the messages are fully loaded before responding to the query, or return an empty array.

jldec commented 2 months ago

same as MESDK-37 / #2