cryptomator / cryptomator/android

Vaults that contain a `'` character in the name can be added but not unlocked after killing and restarting the app

Open
#399 0 comments 0 reactions 0 assignees View on GitHub
storage:google-drive type:bug
Dominant language
Kotlin
Stars
1.2k
Forks
216
PR merge metrics
No merged PRs in 30d

Description

### Please agree to the following

- [X] I have searched [existing issues](https://github.com/cryptomator/android/issues?q=) for duplicates
- [X] I agree to follow this project's [Code of Conduct](https://github.com/cryptomator/android/blob/develop/.github/CODE_OF_CONDUCT.md)

### Summary

Vaults that contain a `'` character in the name can be added but not unlocked after killing and restarting the app

### System Setup

```markdown
- Android: x
- Cryptomator: x
```

### Cloud Type

Google Drive

### Steps to Reproduce

1. Create a vault
2. Rename the vault folder using e.g. the web interface to e.g. `foo ' bar`

### Expected Behavior

The vault can be added and unlocked using the Android app

### Actual Behavior

The vault can be added and unlocked but only until the app gets cold started, after that "An error occurred" is displayed.

### Reproducibility

Always

### Relevant Log Output

```shell
GetUnverifiedVaultConfigUseCase: failed 48448255
org.cryptomator.domain.exception.FatalBackendException: com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
GET https://www.googleapis.com/drive/v3/files?fields=files(id,mimeType,name,size)&q=name%20contains%20'foo%20'%20bar'%20and%20'root'%20in%20parents%20and%20trashed%20%3D%20false
{
"code": 400,
"errors": [
{
"domain": "global",
"location": "q",
"locationType": "parameter",
"message": "Invalid Value",
"reason": "invalid"
}
],
"message": "Invalid Value"
}
at org.cryptomator.data.cloud.googledrive.GoogleDriveCloudContentRepository$Intercepted.resolve(GoogleDriveCloudContentRepository.kt:71)
at org.cryptomator.data.cloud.googledrive.GoogleDriveCloudContentRepository$Intercepted.resolve(GoogleDriveCloudContentRepository.kt:58)
at org.cryptomator.data.cloud.InterceptingCloudContentRepository.resolve(InterceptingCloudContentRepository.kt:38)
at org.cryptomator.data.repository.DispatchingCloudContentRepository.resolve(DispatchingCloudContentRepository.kt:48)
at org.cryptomator.data.cloud.crypto.CryptoCloudFactory.unverifiedVaultConfig(CryptoCloudFactory.java:51)
at org.cryptomator.data.repository.CloudRepositoryImpl.unverifiedVaultConfig(CloudRepositoryImpl.java:96)
at org.cryptomator.domain.usecases.vault.GetUnverifiedVaultConfig.execute(GetUnverifiedVaultConfig.java:28)
at org.cryptomator.domain.usecases.vault.GetUnverifiedVaultConfigUseCase$Launcher$2.call(GetUnverifiedVaultConfigUseCase.java:92)
at org.cryptomator.domain.usecases.vault.GetUnverifiedVaultConfigUseCase$Launcher$2.call(GetUnverifiedVaultConfigUseCase.java:86)
at io.reactivex.internal.operators.flowable.FlowableFromCallable.subscribeActual(FlowableFromCallable.java:39)
at io.reactivex.Flowable.subscribe(Flowable.java:14935)
at io.reactivex.Flowable.subscribe(Flowable.java:14882)
at io.reactivex.internal.operators.flowable.FlowableSubscribeOn$SubscribeOnSubscriber.run(FlowableSubscribeOn.java:82)
at io.reactivex.internal.schedulers.ExecutorScheduler$ExecutorWorker$BooleanRunnable.run(ExecutorScheduler.java:288)
at io.reactivex.internal.schedulers.ExecutorScheduler$ExecutorWorker.run(ExecutorScheduler.java:253)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:920)
Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
GET https://www.googleapis.com/drive/v3/files?fields=files(id,mimeType,name,size)&q=name%20contains%20'foo%20'%20bar'%20and%20'root'%20in%20parents%20and%20trashed%20%3D%20false
{
"code": 400,
"errors": [
{
"domain": "global",
"location": "q",
"locationType": "parameter",
"message": "Invalid Value",
"reason": "invalid"
}
],
"message": "Invalid Value"
}
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:118)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:37)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:428)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1075)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:514)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:455)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:565)
at org.cryptomator.data.cloud.googledrive.GoogleDriveImpl.findFile(GoogleDriveImpl.kt:62)
at org.cryptomator.data.cloud.googledrive.GoogleDriveImpl.folder(GoogleDriveImpl.kt:97)
at org.cryptomator.data.cloud.googledrive.GoogleDriveImpl.resolve(GoogleDriveImpl.kt:53)
at org.cryptomator.data.cloud.googledrive.GoogleDriveCloudContentRepository$Intercepted.resolve(GoogleDriveCloudContentRepository.kt:69)
... 17 more
ErrorCode: 8MCL:0G0T
```

### Anything else?

Other characters gets encoded like e.g. `foo%20%25%20bar` (`foo % bar`).

As Google allows such characters we need to think about a solution here...

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.