Skip to content

Add regression coverage for Shared With Me file lookup collisions - #2089

Closed
FabianDevel with Copilot wants to merge 2 commits into
fix-sharedWithMe-idfrom
copilot/fix-code-review-comment
Closed

FabianDevel with Copilot wants to merge 2 commits into
fix-sharedWithMe-idfrom
copilot/fix-code-review-comment

Conversation

Copilot AI commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Adds the missing regression coverage requested in review for FileController.getFileByUidOrId. The new test locks in correct behavior when Shared With Me entries share the same id across different drives, while preserving the null-userDrive ID lookup fallback.

  • Regression scenario

    • Inserts two Shared With Me File records with the same id and different driveId / uid values.
    • Verifies lookup returns the record matching the supplied drive context.
  • Fallback coverage

    • Inserts a same-id file in the default realm.
    • Verifies getFileByUidOrId(fileId) still resolves via plain File::id when no userDrive is provided.
  • Test placement

    • Adds focused instrumentation coverage in app/src/androidTest/java/com/infomaniak/drive/data/cache/FileControllerTest.kt.
val firstResult = FileController.getFileByUidOrId(
    fileId = duplicatedFileId,
    userDrive = sharedWithMeUserDrive(driveId = firstSharedDriveId),
)

val fallbackResult = FileController.getFileByUidOrId(fileId = duplicatedFileId)

Co-authored-by: FabianDevel <45429131+FabianDevel@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix code as per review comment Add regression coverage for Shared With Me file lookup collisions Sep 18, 2026
Copilot AI requested a review from FabianDevel September 18, 2026 07:36
@sonarqubecloud

Copy link
Copy Markdown

@FabianDevel
FabianDevel removed this pull request from stack #2090 September 18, 2026 10:58
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