Registry Mirror
Skip to content

Conversation

@jcompagner

Copy link
Copy Markdown

Issue for this PR

#28242

Closes #28242

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

On Windows, the web UI frontend normalizes paths to forward slashes (C:/Users/...) but the database stores backslashes (C:\Users...). This caused session list queries to return 0 results after a page refresh, because the directory filter did an exact string match.

Add normalizeDirectory() that converts forward slashes to backslashes on Windows when the path looks like a drive letter path (X:/...). Apply it in the workspace-routing middleware and the session list handler.

How did you verify your code works?

i run the dev server and opened a project made some sessions and just refresh the page
Or just restart the server and let the browser reload itself, mostly on windows you loose all the sessions (or keep only 1 for some reason)

Screenshots / recordings

If this is a UI change, please include a screenshot or recording.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

…atching

On Windows, the web UI frontend normalizes paths to forward slashes
(C:/Users/...) but the database stores backslashes (C:\Users\...).
This caused session list queries to return 0 results after a page
refresh, because the directory filter did an exact string match.

Add normalizeDirectory() that converts forward slashes to backslashes
on Windows when the path looks like a drive letter path (X:/...).
Apply it in the workspace-routing middleware and the session list handler.
@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on the search results, I found several related PRs that are potentially addressing the same issue:

Potential Duplicate/Related PRs:

  1. PR fix(session): match Windows directory separators #28027 - fix(session): match Windows directory separators

    • Directly related to Windows directory path matching issue
  2. PR fix(session): normalize session directory filters across path variants #28040 - fix(session): normalize session directory filters across path variants

    • Addresses session directory filter normalization across different path formats
  3. PR fix: normalize Windows session directory filters #26463 - fix: normalize Windows session directory filters

    • Historical fix for similar Windows session directory filter issue
  4. PR fix: sessions missing from sidebar on Windows due to path separator mismatch #23862 - fix: sessions missing from sidebar on Windows due to path separator mismatch

    • Earlier PR addressing the same root cause of sessions disappearing on Windows
  5. PR fix(app): normalize watcher paths #24341 - fix(app): normalize watcher paths

    • Related path normalization for Windows

The most relevant are PR #28027 and PR #28040, which appear to be addressing the same Windows directory separator and path normalization issues that PR #28251 is tackling. You should check if any of these are still open and if they overlap with your changes.

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

On windows we have a problem with "opencode web" because forward and backward slashes are mixed up

1 participant