[BUG] Object storage upload keys use backslashes on Windows

Open Beginner friendly
#629 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
86/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
backend, cloud

Research direction

Start in backend/modules/foundation/domain/file/service and run the provided Windows-focused Go test command for TestFileServiceImpl_UploadLoopFile and TestFileServiceImpl_UploadFileForServer. Trace how those methods construct object-storage keys, then verify the tests pass with platform-independent forward-slash keys, including the prefix-only space/ expectation.

Written by the indexing model from the issue text.

Description

📋 CheckList
  • I have searched existing issues to avoid duplicates
  • I am using a recently maintained version of Coze Loop
  • I have provided all required information
  • I understand this is a bug report and not a feature request
  • I have submitted this report in English (otherwise it will not be processed)
🐛 Bug Description

UploadLoopFile and UploadFileForServer construct object-storage keys with filepath.Join. On Windows, this produces backslash-separated keys, even though object-storage keys and the existing test contract use forward slashes.

🔄 Steps to Reproduce
  1. Check out current main on Windows.
  2. Run:
cd backend
go test -count=1 -run 'TestFileServiceImpl_Upload(LoopFile|FileForServer)$' -v ./modules/foundation/domain/file/service
  1. Observe failures in both upload methods because generated keys contain backslashes.
✅ Expected Behavior

Object-storage keys are platform-independent, for example 1234567890/testfile.txt and workspace/custom.txt.

❌ Actual Behavior

On Windows, the keys are generated as 1234567890\testfile.txt and workspace\custom.txt. Prefix-only uploads similarly fail the existing space/ expectation.

🚨 Severity

Medium - Minor functionality affected

🔧 Component

Infrastructure

💻 Environment
  • OS: Windows 11
  • Go: go1.26.3 windows/amd64
  • Coze Loop: a2c804de6f95a209a1bd6cb6489c5a76221abd20 (current main when reproduced)
🔧 Go Environment

Relevant values: GOOS=windows, GOARCH=amd64, GOVERSION=go1.26.3.

📋 Logs
expected: "1234567890/testfile.txt"
actual  : "1234567890\\testfile.txt"

expected: "workspace/custom.txt"
actual  : "workspace\\custom.txt"
📝 Additional Context

The storage-key path should use the slash-oriented path package rather than the OS-filesystem-oriented path/filepath package. The existing tests already encode the expected portable key format.

Dominant language
Go
Stars
5.7k
Forks
795
Avg merge
1d 4h
Merged PRs (30d)
29

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from coze-dev/coze-loop

All issues in coze-dev/coze-loop

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.