Skip to content

Conversation

@amannn
Copy link
Owner

@amannn amannn commented Nov 14, 2025

Implement atomic file writes for catalog persistence to prevent intermittent data loss where .po files could be truncated to empty strings during write operations.

The bug was hard to reproduce, but users reported that translation files (e.g., pt.po, es.po) occasionally became empty. This suggests a race condition or an interrupted write operation where the file might be truncated before new content is fully written. By writing to a temporary file and then atomically renaming it, we ensure that the target file is only updated with complete, valid content, preventing scenarios where it could briefly appear empty or corrupted.


Open in Cursor Open in Web

@cursor
Copy link

cursor bot commented Nov 14, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel
Copy link

vercel bot commented Nov 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
next-intl-docs Ready Ready Preview Comment Nov 14, 2025 2:01pm
next-intl-example-app-router Ready Ready Preview Comment Nov 14, 2025 2:01pm
next-intl-example-app-router-without-i18n-routing Ready Ready Preview Comment Nov 14, 2025 2:01pm

@amannn amannn mentioned this pull request Nov 19, 2025
31 tasks
@JuliusGudni
Copy link

Happened to me quite a few times before I figured out what it was. The complete file got emptied every time after adding fuzzy comments in Poedit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants