Skip to content

Fix: force refresh of remote tree on precalculation and replace relative with the custom relative on create backup upload executor - #305

Merged
AlexisMora merged 2 commits into
mainfrom
fix/force-remote-refresh-on-precalculation__use-custom-relative
Apr 9, 2026
Merged

AlexisMora merged 2 commits into
mainfrom
fix/force-remote-refresh-on-precalculation__use-custom-relative

Conversation

@AlexisMora

@AlexisMora AlexisMora commented Apr 9, 2026

Copy link
Copy Markdown

What is Changed / Added

create-backup-upload-executor.ts: Changed the relative import from node:path to the project's custom relative utility apps/backups/utils/relative. Node's relative produces paths without a leading / for example sub1/file.txt, while the RemoteTree keys folders with a leading / for example: /sub1. This mismatch caused remoteTree.getParent() to throw when looking up parent folders for file uploads, silently aborting the async queue.

precalculate-backup-item-count.ts: Added forceRefresh: true to the remoteTreeBuilder.run() call so the remote tree is always fetched fresh before precalculating item counts.


Why

The original sequential upload code used the custom relative utility, but the new create-backup-upload-executor.ts imported relative from node:path. This caused backups of folders with subfolders to create the folder structure correctly but skip all file uploads and making the parent lookup failed because sub1 != /sub1, the error was unhandled inside the async queue, and the queue silently stopped processing.

The forceRefresh change ensures that repeated manual backups always diff against the latest remote state, preventing stale tree data from causing unnecessary 409 conflicts or incorrect diff calculations.

…ive with the custom relative on create backup upload executor
@AlexisMora AlexisMora self-assigned this Apr 9, 2026
@AlexisMora AlexisMora added the bug Something isn't working label Apr 9, 2026
@sonarqubecloud

sonarqubecloud Bot commented Apr 9, 2026

Copy link
Copy Markdown

@AlexisMora
AlexisMora merged commit 7b2ba53 into main Apr 9, 2026
9 checks passed
@AlexisMora
AlexisMora deleted the fix/force-remote-refresh-on-precalculation__use-custom-relative branch April 9, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants