Skip to content

fix: keep the file list up to date after uploads - #3587

Merged
AlexAndBear merged 2 commits into
mainfrom
fix/file-list-after-uploads
Oct 9, 2026
Merged

AlexAndBear merged 2 commits into
mainfrom
fix/file-list-after-uploads

Conversation

@AlexAndBear

Copy link
Copy Markdown
Member

Description

  • Footer size: “N items with X in total” sums the listed resources instead of using the folder size from the first PROPFIND, so it updates after upload, delete and copy.
  • Replaced files: after an upload with “Replace”, resources with a changed etag are updated, so size and date are current without reload.
Before After
Footer after delete b14 a14
Replace upload b15 a15

Related Issue

  • No issue, found in the functional bug sweep of the web client

How Has This Been Tested?

  • test environment: local dev server, Playwright (Chromium)
  • upload and delete a file: footer total updates without reload
  • replace an existing file by upload: row size changes from 20 B to 50 B without reload
  • unit tests added

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

Comment on lines +84 to +86
const existingEtags = new Map(resourcesStore.resources.map((r) => [r.id, r.etag]))
const changedResources = children.filter((child) => existingEtags.get(child.id) !== child.etag)
resourcesStore.upsertResources(changedResources)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upsertResources doesn't merge but overwrites resources, leading to thumbnail and remoteItemId getting lost. You can see this in a share space, where replacing a resource now resets the preview image to the default one (because SSE isn't there to cover for it).

@AlexAndBear AlexAndBear Oct 9, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, this turned out to be a general problem: a changed row is never re-rendered, so its preview isn't loaded again. Rows and tiles are now keyed by etag (fixes it for SSE, uploads and other updates), and the upload sets the share id like the folder loader does.

This also fixes:

  • Replaced files without SSE: on main the list didn't update replaced files at all, the old preview, size and etag stayed.
  • Previews in the tiles view after SSE updates: the SSE handler loads thumbnail-sized previews, the re-rendered tile now loads one in tile size.
  • Saving in apps: AppWrapper sets the new etag after saving, so the list now shows the updated preview instead of the old one.

@AlexAndBear
AlexAndBear requested a review from JammingBen October 9, 2026 09:05
@AlexAndBear
AlexAndBear force-pushed the fix/file-list-after-uploads branch from dace666 to c90a6db Compare October 9, 2026 12:38
@AlexAndBear
AlexAndBear merged commit 4679cf0 into main Oct 9, 2026
31 checks passed
@AlexAndBear
AlexAndBear deleted the fix/file-list-after-uploads branch October 9, 2026 15:20
@openclouders openclouders mentioned this pull request Oct 9, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants