fix: (regression 3.1.0) frontend crash with % in filename
Massimo Melina committed
May 14, 2026 at 00:20 UTC
f5e7ee2bfffb4b36f2102a9319d70ca0c01f58ff
3 files changed
+12
-4
e2e/frontend.spec.ts
+5
-1
@@ -148,7 +148,7 @@ test('search1', async ({ page }) => {
148
await page.getByRole('button', { name: 'Search' }).click()
149
await page.locator('input[name="name"]').fill('a*')
150
await page.locator('input[name="name"]').press('Enter')
151
- await page.getByText('files, 36 B').click()
151
+ await page.getByText('files, 42 B').click()
152
153
await page.getByRole('link', { name: 'home' }).click()
154
await page.getByRole('button', { name: 'Close' }).click()
@@ -356,4 +356,8 @@ test('order field', async ({ page }) => {
356
await page.goto(FRONTEND_URL + 'renameChild/orderTest/')
357
await expect(page.getByText('orderTest')).toBeVisible()
358
await expect(page.locator('.entry-name')).toHaveText(['B', 'A', 'C'])
359
+ await page.goto(FRONTEND_URL + 'renameChild/')
360
+ await page.getByRole('link', { name: 'gui#%2, Folder' }).click()
361
+ await expect(page.getByRole('link', { name: 'alfa.txt' })).toBeVisible()
362
+ await expect(page.getByText('Not found')).not.toBeVisible()
363
})
frontend/src/router.ts
+2
-2
@@ -26,8 +26,8 @@ export function useNavigate() {
26
}
27
28
export function useLocation(): { pathname: string } {
29
- const [pathname] = useWouterLocation()
30
- return { pathname }
29
+ useWouterLocation() // used just to cause render
30
+ return { pathname: location.pathname }
31
}
32
33
type RouteProps = {
tests/config.yaml
+5
-1
@@ -77,6 +77,10 @@ vfs:
77
rename:
78
alfa.txt: renamed1
79
page/gpl.png: renamed2
80
+ - name: gui#%2
81
+ can_see: true
82
+ children:
83
+ - source: ../alfa.txt
84
- name: orderTest
85
can_see: true
86
children:
@@ -227,7 +231,7 @@ accounts:
231
admins:
232
allow_net: ::1
233
admin: true
230
-version: 3.1.4
234
+version: 3.2.0-alpha1
235
max_downloads_per_account: 2
236
max_downloads: 1
237
roots: