fix: land on device source and stop indexing mounted disks - #8
Conversation
New users get their scopes in config source order (settings builds DefaultScopes by iterating Server.Sources) and the UI lands on scopes[0], so a fresh login opened the empty /data/files source and showed "nothing to show here". The old app started at /, so this read as a regression. Put device first, and assert the landing source in the UI journey instead of clicking past it. The device source is rooted at / and its usage bar divides an index-walk sum by a statfs of the root partition. The walk descends into /opt/disk, so on a device with an external disk the whole disk was counted against the system partition -- a user reported 1.8 TB / 118.8 GB (1580%) -- and every scan re-walked terabytes of content the files source already covers. Exclude the mount point and its /data symlink from indexing, viewable so browsing still works. Refs https://syncloud.discourse.group/t/files-nothing-to-show-here/670
The welcome prompt is gated on ShowFirstLogin, set at user creation to IsFirstLoad && admin, and IsFirstLoad is true only when filebrowser had no database file at startup. After an upgrade the store version has already created the database, so the user created at first login never gets the prompt and the unconditional wait times out. This only started biting now: the upgrade test installs the released app from the store, and until that became FileBrowser Quantum the old side was the legacy python app, which creates no filebrowser database. The spec would fail on master untouched. Dismiss the prompt through a locator handler so the run works whether or not it appears, instead of racing its arrival.
VerificationCI: build 190 green on all three pipelines (amd64/arm64/arm), including Landing source — after-upgrade screenshot ( Exclusion rule — CI can't cover this (its platform images are single-disk, so
The excluded subtree drops out of the index and out of the size aggregate, and stays fully browsable through the API — which is the behaviour this fix depends on. One correction to the description above: Second commit
Now dismissed through a locator handler, so the run works whether or not the prompt appears — confirmed by the artifacts: the fresh-install run has |
Verified on real hardware (borisarm64), and one correctionInstalled build 190 ( The exclusion works. Queried the index DB (
Correction to the "not covered here" note in the description. I claimed existing users keep But the caveat survives, via a different field. That also explains the reporter's screenshot, where So: new installs land on |
Reported at https://syncloud.discourse.group/t/files-nothing-to-show-here/670 — the new Files app opens on "nothing to show here", and the sidebar shows
deviceat1.8 TB / 118.8 GB (1580%).Landing source
New users get their scopes in config source order (
settingsbuildsDefaultScopesby iteratingServer.Sources), and the UI lands onscopes[0](Files.vueredirects/filesto/files/${sources.current},mutations.setSourcessetscurrent = user.scopes[0].name).fileswas first, and/data/filesis created empty byInitStorage, so a fresh login landed on an empty folder. The old Python app started at/.deviceis now first, so the first screen has content andfilesis one click away in the sidebar.Usage bar / indexing
The
devicesource is rooted at/. Its bar dividesUsedAsIndexed(summed from the index walk) byDiskTotal(statfs of the partition holding the source root). The walk descends into/opt/disk, so on a device with an external disk the entire disk is counted against the system partition — hence 1580%.The percentage is cosmetic; the cost is not. Every scan re-walks the whole external drive, on a home NAS, indexing content the
filessource already covers./opt/diskand the platform's/datasymlink to it are now excluded from indexing on thedevicesource, withviewable: trueso browsing still works. During a routine scan an exactfolderPathmatch prunes the subtree;viewablekeeps the API path accessible.Testing
The UI journey now waits for
/files/deviceafter login rather than clicking the source button, so a regression in landing order fails CI.The percentage itself is not covered: CI platform images are single-disk, so
usedandtotalcome from the same partition and the >100% condition cannot arise. Verified the rule semantics against upstream v1.4.0-stable instead.Not covered here
Scopes are persisted per user at account creation and the OIDC login path only updates
Permissionsfor an existing user, so accounts created before this change keepfilesfirst and will still land on the empty source. Fixing those needs a scope migration against the bolt DB, which is deliberately out of scope for this PR.