Skip to content

Conversation

@ImL1s
Copy link

@ImL1s ImL1s commented Jan 17, 2026

Summary

  • Fixes session sync failures when folder names contain special characters (underscores, dots)
  • Adds normalizePathForKey() function to normalize paths consistently with Claude Code's .claude/projects folder naming convention

Test plan

  • Test with folders containing underscores like test_temp_01
  • Verify session sync works when switching between local and remote modes

Fixes #368

🤖 Generated with Claude Code

yamiweb3 and others added 2 commits January 18, 2026 02:11
Claude Code converts folder paths with special characters (underscores, dots, etc.)
to hyphens when creating .claude/projects folders. This fix ensures the mobile app
uses the same normalization for consistent session sync.

- Add normalizePathForKey utility function
- Apply normalization in projectManager, gitStatusSync, and sessionUtils
- Add unit tests for path normalization

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 17, 2026 18:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes session synchronization failures when folder names contain special characters (underscores, dots, etc.) by implementing path normalization that matches Claude Code's .claude/projects folder naming convention.

Changes:

  • Added normalizePathForKey() utility function to convert paths to Claude Code's naming convention (replacing special characters with hyphens)
  • Updated session/project key generation in sessionUtils.ts, projectManager.ts, and gitStatusSync.ts to use normalized paths
  • Added comprehensive test suite with 214 test cases covering edge cases including Unicode, Windows paths, and special characters

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sources/utils/normalizePathForKey.ts New utility function implementing path normalization logic
sources/utils/normalizePathForKey.spec.ts Comprehensive test suite with extensive edge case coverage
sources/utils/sessionUtils.ts Updated getSessionAvatarId() to use normalized paths
sources/sync/projectManager.ts Updated getProjectKeyString() to use normalized paths
sources/sync/gitStatusSync.ts Updated getProjectKeyForSession() to use normalized paths
sources/changelog/changelog.json Added version 6 entry documenting the fix
CHANGELOG.md Added version 6 entry documenting the fix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e023bcf71b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 54 to +55
private getProjectKeyString(key: ProjectKey): string {
return `${key.machineId}:${key.path}`;
return `${key.machineId}:${normalizePathForKey(key.path)}`;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid merging distinct projects that normalize to same key

Normalizing the path here makes the project key lossy, so two different directories on the same machine that differ only by characters you replace (e.g., /Users/dev/foo_bar vs /Users/dev/foo.bar, or double-hyphen vs single-hyphen) now collapse to the same key. That causes project grouping, git status sharing, and session management to merge unrelated projects. This is a new behavioral regression introduced by the normalization; if the goal is Claude Code compatibility for sync, you may need a separate normalized key for matching while preserving a lossless key for local project identity.

Useful? React with 👍 / 👎.

@ImL1s ImL1s force-pushed the fix/normalize-path-for-key branch from e023bcf to 4060ab8 Compare January 17, 2026 18:26
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.

When folder names contain an underscore ('_'), it causes information on the local end to fail to synchronize to the mobile end

2 participants