Skip to content

fix: persist telemetry state as utf-8#5336

Open
Ghraven wants to merge 1 commit into
mem0ai:mainfrom
Ghraven:fix-server-telemetry-state-utf8
Open

fix: persist telemetry state as utf-8#5336
Ghraven wants to merge 1 commit into
mem0ai:mainfrom
Ghraven:fix-server-telemetry-state-utf8

Conversation

@Ghraven
Copy link
Copy Markdown

@Ghraven Ghraven commented Jun 1, 2026

What changed

  • Read and write the server telemetry state file with explicit encoding="utf-8".
  • Added a focused test that round-trips non-ASCII telemetry state through _save_state() and _load_state().

Problem

The telemetry state file stores JSON text but currently relies on the platform default encoding. On non-UTF-8 systems, state containing non-ASCII operator input, such as onboarding use-case text, can be decoded or written inconsistently.

Before/after

Before: STATE_PATH.read_text() and STATE_PATH.write_text(...) used the process default encoding.
After: telemetry state JSON is consistently read and written as UTF-8.

Verification

  • python -m pytest tests/test_server_telemetry.py

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@Ghraven
Copy link
Copy Markdown
Author

Ghraven commented Jun 1, 2026

I have read the CLA Document and I hereby sign the CLA

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.

2 participants