Skip to content

Conversation

@jzunigax2
Copy link

@jzunigax2 jzunigax2 commented Dec 24, 2025

Fixes multiple test failures by addressing API timeout handling, empty file support, and file download issues.

Empty file handling

  • Return fs.ErrorCantUploadEmptyFiles when backend doesn't support empty files
  • Fixes VFS writeback tests that expect proper error handling

Timeout/conflict recovery

  • A bit of an edge case but added defensive recovery from HTTP/2 timeout errors
  • Check if file/folder exists after timeout using existence check API
  • Treat as success if operation completed server-side despite client timeout
  • Prevents 409 conflicts on retry when operation already succeeded

File reading bug fix

  • Set o.id = meta.FileID after upload to enable file downloads
  • Fixes "File id is malformed" 400 errors when reading uploaded files

Retry logic improvements

  • Wrap folder/file operations with pacer for consistent retry behavior
  • Handle 401 Unauthorized errors with retry
  • Add conflict detection for folder creation (409 → find existing)

Other fixes

  • Add EncodeCrLf to default encoder

Test Results

  • Before: 5 failing test suites
  • After: 1 test with known limitation (empty files not supported by API)
  • Fixed: fs/sync, backend/internxt, cmd/bisync, cmd/gitannex, fs/operations, VFS file reading

Note: simulateEmptyFiles should probably be removed in an upcoming refactor PR, I am yet to asses the implications of empty file handling

@jzunigax2 jzunigax2 self-assigned this Dec 29, 2025
@jzunigax2 jzunigax2 requested a review from AlexisMora December 29, 2025 20:59
@jzunigax2 jzunigax2 changed the title Fix/fix failing tests [PB-5623]: fix/fix failing tests Dec 29, 2025
@jzunigax2 jzunigax2 force-pushed the fix/fix-failing-tests branch from 2ac736f to ad56d4c Compare December 29, 2025 21:02
@jzunigax2 jzunigax2 marked this pull request as ready for review December 29, 2025 21:02
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