opral / inlang-message-sdk

0 stars 0 forks source link

Git Revert causes `Unexpected end of JSON input` error & breaks reactivity #91

Open LorisSigrist opened 3 weeks ago

LorisSigrist commented 3 weeks ago

Context

When an edit to a message file (eg messages/en.json) is reverted via git, the SDK outputs an Unexpected end of JSON input error over project.errors.subscribe(). Subsequent edits to that file don't trigger any updates.

My theory is that the git restore quickly removes & re-adds the file causing the SDK to read an empty JSON file & fs.watch to loose track of updates.

Proposal

Fix that

jldec commented 3 weeks ago

related to MESDK-91
propose using directory watch instead.