You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(types): remove file id from drive types - #2346
Files are identified by uuid now, but DriveFileData still had the numeric id and Thumbnail still had file_id. Code could keep using the old identifier and the compiler wouldn't complain.
This PR removes both fields from the types and from the places that build file objects.
It also bumps @internxt/sdk to 1.27.0, which drops the same fields on its side and makes FetchTrashContentResponse generic, so the workspace trash response is now typed as files or folders.
Unit tests have been written or updated as necessary.
The code adheres to the repository's coding standards.
Relevant documentation has been added or updated.
No new warnings or errors have been introduced.
SonarCloud issues have been reviewed and addressed.
QA Passed
Testing Process
tsc --noEmit passes against SDK 1.27.0.
Affected unit tests pass.
Additional Notes
DriveItemData is DriveFileData & DriveFolderData, so item.id still compiles through the folder type. If file code still reads id from there, this PR won't catch it.
Summary by CodeRabbit
Updates
Drive file records and thumbnails no longer include legacy numeric identifiers. File previews and related operations continue to use the remaining file metadata.
Trash retrieval now returns more specific file and folder result types.
Maintenance
Updated test data to reflect the current file and thumbnail metadata. Existing checks for downloads, previews, and cached content remain in place.
Review was skipped as selected files did not have any reviewable changes.
Files ignored due to path filters: 1
yarn.lock is excluded by !**/yarn.lock, !**/*.lock
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 5f414be5-3387-4b82-9fc1-5027d80fdf91
Commits
Reviewing files that changed from the base of the PR and between 030cb56 and 811c52a.
Files ignored due to path filters: 1
yarn.lock is excluded by !**/yarn.lock, !**/*.lock
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The SDK pin changes to 1.27.0, and getTrashItems uses an explicit trash response type. Drive file and thumbnail types, mappings, and test fixtures no longer include numeric identifier fields.
Changes: Trash response typing
Layer / File(s)
Summary
SDK and trash response typing package.json, src/services/workspace.service.ts
The pinned SDK version changes to 1.27.0. getTrashItems returns FetchTrashContentResponse<TrashedFile | TrashedFolder>.
Drive identifier removal
Layer / File(s)
Summary
Drive data shapes and mappings src/app/drive/types/index.ts, src/utils/driveThumbnail.utils.ts, src/views/Drive/DriveView.tsx, src/views/PublicShared/utils/mapSharedItemToPreviewFile.ts
DriveFileData no longer declares id, and Thumbnail no longer declares file_id. The thumbnail and preview-file mappings omit those fields.
Drive fixtures and tests src/app/drive/components/FileViewer/..., src/app/drive/services/..., src/app/store/slices/storage/fileUtils/prepareFilesToUpload.test.ts, src/testUtils/fixtures/*, src/views/PublicShared/utils/mapSharedItemToPreviewFile.test.ts
Test fixtures no longer set id or file_id. Existing UUID-based download and cache assertions remain.
internxt/drive-web#2330: Changes the local file cache key and viewer file identity from numeric id to UUID, connecting to this PR’s removal of id from DriveFileData.
Suggested reviewers:xabg2, terrerox
Merge Risk: Minimal · previous review a773f
This change removes legacy numeric identifier fields from Drive file and thumbnail data and upgrades the SDK. No actionable merge-blocking risk was found. Normal CI should confirm the typecheck and tests.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "refactor(types): remove file id from drive types" matches the main change. The PR removes the numeric id from DriveFileData and file_id from Thumbnail, and it updates the code and t…
Description check
The description follows the repository template. It has a clear summary that explains the reason for removing id and file_id, and it lists the SDK bump and its effect on the workspace trash respon…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "refactor(types): remove file id from drive types" matches the main change. The PR removes the numeric id from DriveFileData and file_id from Thumbnail, and it updates the code and test fixtures that depended on them. The title is specific and concise. It does not mention the @internxt/sdk bump to 1.27.0 or the generic FetchTrashContentResponse change, but the title does not need to cover every detail.
Full details: Description check
Explanation
The description follows the repository template. It has a clear summary that explains the reason for removing id and file_id, and it lists the SDK bump and its effect on the workspace trash response. It links a related SDK PR and gives testing notes. Gaps: the Related Issues section is empty, most checklist items are unchecked, and the Testing Process section does not describe local manual testing. The Additional Notes section raises a useful limitation about item.id still compiling through DriveFolderData.
Resolution
Consider these improvements: (1) Add a linked issue under Related Issues, or write "None" if no issue exists. (2) Update the checklist items that the author completed, or explain why they remain unchecked. In particular, state whether local testing was done. (3) Add the test commands or steps that were run, not only the result summary. (4) Describe how the remaining item.id reads on file code will be found, for example with a lint rule or a follow-up task.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Files are identified by
uuidnow, butDriveFileDatastill had the numericidandThumbnailstill hadfile_id. Code could keep using the old identifier and the compiler wouldn't complain.This PR removes both fields from the types and from the places that build file objects.
It also bumps
@internxt/sdkto 1.27.0, which drops the same fields on its side and makesFetchTrashContentResponsegeneric, so the workspace trash response is now typed as files or folders.Related Issues
Related Pull Requests
files.idfrom drive typesChecklist
Testing Process
tsc --noEmitpasses against SDK 1.27.0.Additional Notes
DriveItemDataisDriveFileData & DriveFolderData, soitem.idstill compiles through the folder type. If file code still readsidfrom there, this PR won't catch it.Summary by CodeRabbit