Skip to content

Commit ce0823a

Browse files
authored
Merge branch 'master' into dill21yu-patch-1
2 parents bbeedba + 17f6e56 commit ce0823a

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

desktop/core/src/desktop/js/apps/storageBrowser/StorageBrowserTab/StorageBrowserTab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const StorageBrowserTab = ({ fileSystem, testId }: StorageBrowserTabProps): JSX.
8383
error,
8484
reloadData
8585
} = useLoadData<FileStats, { path: string }, AxiosError>(FILE_STATS_API_URL, {
86-
fetchOptions: { isRawError: true },
86+
options: { isRawError: true },
8787
params: { path: filePath },
8888
skip: !filePath
8989
});

desktop/core/src/desktop/js/utils/hooks/useLoadData/useLoadData.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { convertKeysToCamelCase } from '../../../utils/string/changeCasing';
2020

2121
export interface Options<T, U, E> {
2222
params?: U;
23-
fetchOptions?: ApiFetchOptions<T, E>;
23+
options?: ApiFetchOptions<T, E>;
2424
skip?: boolean;
2525
onSuccess?: (data: T) => void;
2626
onError?: (error: E) => void;
@@ -44,7 +44,7 @@ const useLoadData = <T, U = unknown, E = string>(
4444
const [loading, setLoading] = useState<boolean>(false);
4545
const [error, setError] = useState<E>();
4646

47-
const fetchOptionsDefault: ApiFetchOptions<T, E> = {
47+
const optionsDefault: ApiFetchOptions<T, E> = {
4848
silenceErrors: true,
4949
ignoreSuccessErrors: true
5050
};
@@ -72,8 +72,8 @@ const useLoadData = <T, U = unknown, E = string>(
7272
setError(undefined);
7373

7474
const fetchOptions = {
75-
...fetchOptionsDefault,
76-
...localOptions?.fetchOptions
75+
...optionsDefault,
76+
...localOptions?.options
7777
};
7878

7979
try {

desktop/core/src/desktop/lib/fs/s3/core/s3fs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ def stats(self, path: Union[str, S3Path]) -> S3Stat:
213213
except FileNotFoundError:
214214
# Check if it's a prefix (directory)
215215
try:
216-
response = self.s3_client.list_objects_v2(Bucket=path.bucket, Prefix=path.key, Delimiter=S3_DELIMITER, MaxKeys=1)
216+
# For directory check, append '/' to avoid matching files that start with same prefix
217+
directory_prefix = path.key.rstrip("/") + "/"
218+
response = self.s3_client.list_objects_v2(Bucket=path.bucket, Prefix=directory_prefix, Delimiter=S3_DELIMITER, MaxKeys=1)
217219
if response.get("CommonPrefixes") or response.get("Contents"):
218220
return S3Stat.for_directory(path)
219221
raise FileNotFoundError(f"Path not found: {path}")

0 commit comments

Comments
 (0)