Repository navigation
Conversation
|
@terrerox This branch is full of conflicts now; they should be resolved first |
b985e99 to
a64d666
Compare
|
e599696 to
01fb3f7
Compare
…bnail paths Uploads of files whose names contain spaces or non-ASCII characters failed with ENOENT because percent-encoded cache URIs were passed unmodified to RNFS.copyFile and to the native thumbnail generator. Decode the source URI before copy (copyFileFromEncodedUri) and the native-returned thumbnail URI (fromFileUri); drop the stale manual %20 encoding. Device-verified on Android.
…deUriSafely functions
008265e to
c66ee72
Compare
| useLegacyPackaging enableLegacyPackaging.toBoolean() | ||
| } | ||
| resources { | ||
| excludes += 'META-INF/versions/9/OSGI-INF/MANIFEST.MF' |
There was a problem hiding this comment.
Also fixed an Android launch crash here (NoClassDefFoundError: okhttp3/internal/Util). We pin okhttp 5.3.2, but React Native's okhttp-urlconnection was still on 4.9.2 and crashed once Cloudflare set the _cfuvid cookie. I added okhttp-urlconnection:5.3.2 and excluded the duplicate META-INF/versions/9/OSGI-INF/MANIFEST.MF it brings, which was breaking the build. This affects master too.
| import { decodeUriSafely } from '../uri/uriHelpers'; | ||
|
|
||
| export async function copyFileFromEncodedUri(sourceUri: string, destPath: string): Promise<void> { | ||
| await fileSystemService.copyFile(decodeUriSafely(sourceUri), destPath); |
There was a problem hiding this comment.
This also decodes content:// URIs, which breaks them: the %2F inside the document id becomes a real / and the URI no longer points to the file. It can happen when keepLocalCopy fails and AddModal falls back to the picker URI.
It would be good to add a test with a content:// URI.
bd554fc to
7918c83
Compare
… for content URIs
|
CandelR
left a comment
There was a problem hiding this comment.
The base branch replaced the BottomModal with FloatingActionMenu, so the void changes from the last commit are on code that no longer exists. Taking the base side there should resolve it, and the Sonar issue should go away with it since it is in the same removed block :)
| import fileSystemService from '@internxt-mobile/services/FileSystemService'; | ||
| import { decodeFileUriSafely } from '../uri/uriHelpers'; | ||
|
|
||
| export async function copyFileFromEncodedUri(sourceUri: string, destPath: string): Promise<void> { |
There was a problem hiding this comment.
nit: use arrow functions :)
| * Converts a file:// URI to a filesystem path: strips the leading `file://` scheme and | ||
| * percent-decodes the rest. Malformed percent sequences are kept as-is instead of throwing. | ||
| */ | ||
| export const fileUriToPath = (uri: string): string => |
There was a problem hiding this comment.
fileUriToPath does almost the same as stripFileUri. Could we make stripFileUri use decodeUriSafely instead and keep a single helper? That way thumbnail.generation.ts does not need to change and the other callers of stripFileUri stop throwing on a stray % too







Uploads of files whose names contain spaces or non-ASCII characters failed with ENOENT because percent-encoded cache URIs were passed unmodified to RNFS.copyFile and to the native thumbnail generator. Decode the source URI before copy (copyFileFromEncodedUri) and the native-returned thumbnail URI (fromFileUri); drop the stale manual %20 encoding. Device-verified on Android.