Skip to content

fix: bound space file ID matching - #3262

Merged
JammingBen merged 3 commits into
opencloud-eu:mainfrom
fredrikblau:fix/3241-bound-file-id-matching
Aug 31, 2026
Merged

fix: bound space file ID matching#3262
JammingBen merged 3 commits into
opencloud-eu:mainfrom
fredrikblau:fix/3241-bound-file-id-matching

Conversation

@fredrikblau

Copy link
Copy Markdown
Contributor

Description

Space selection from a file ID currently uses an unbounded string prefix. When one space ID is a prefix of another, a file from the longer ID can resolve to the wrong space.

Match the complete space ID or the ! separator used before an item ID, and cover the prefix collision with a regression test.

Related Issue

How Has This Been Tested?

  • test environment: Node.js 26.7.0, pnpm 11.24.0
  • test case 1: pnpm test:unit --run packages/web-pkg/tests/unit/helpers/spaces/driveAlias.spec.ts
  • test case 2: pnpm check:types
  • test case 3: pnpm lint
  • test case 4: pnpm format:check

Types of changes

  • Bugfix
  • Enhancement (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt (improving code quality without changing functionality)
  • Tests (adding or updating tests)
  • Documentation (updates to the documentation, readme, or changelog)
  • Maintenance (updates to the build process or auxiliary tools and libraries)

@JammingBen JammingBen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This doesn't fix the issue. fileId in getSpaceForDriveAliasAndItem is undefined for trash routes, which is the real issue. You need to pass it manually to the route like e.g. useSpaceActionsNavigateToTrash does.

@JammingBen
JammingBen force-pushed the fix/3241-bound-file-id-matching branch from 39fccab to 658f0a4 Compare August 31, 2026 09:03

@JammingBen JammingBen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

馃憤

@JammingBen
JammingBen merged commit 956607f into opencloud-eu:main Aug 31, 2026
31 checks passed
@openclouders openclouders mentioned this pull request Aug 31, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vault unlock can mix up spaces with identical names in trash bin

3 participants