Conversation
Always attempt to remove the SMB connection test file and local temp file in a finally block. Move client and tmpPath initialization outside the try so deleteFile/unlink are always accessible, remove the fragile remoteFileCreated flag, and unconditionally call client.deleteFile(destination) with errors ignored. Add unit tests that verify cleanup runs when sendFile throws and that deleteFile is retried when it initially fails. Update changelog to document the bug fix and new tests.
Cast MSSQL size values to BIGINT before multiplying to avoid "Arithmetic overflow error converting expression to data type int" for large databases. Updated queries in src/lib/adapters/database/mssql/browser.ts (CAST a.total_pages AS BIGINT) and src/lib/adapters/database/mssql/connection.ts (CAST mf.size AS BIGINT) and added a changelog entry in docs/changelog.md describing the fix.
Standardize the Grandfather-Father-Son retention abbreviation to GFS across the codebase and docs. Updated documentation, README, UI strings, and unit test descriptions to use "GFS" instead of "GVS", and adjusted function/documentation references accordingly. Added a Prisma migration to rename the built-in retention template from "Smart GVS (7/4/12/2)" to "Smart GFS (7/4/12/2)" (conditional update by id/name). This change is purely a terminology correction for clarity and consistency.
Ensure SMART/GFS tiers do not collapse onto the same newest backup by refactoring retention logic into non-overlapping tiers. RetentionService.applySmartPolicy now uses a generic applyTier helper that picks unique UTC bucket representatives per tier (daily, weekly, monthly, yearly) using date-fns-tz formatInTimeZone. Added retentionPolicyName and retentionPolicySource to DestinationContext and populated them in stepInitialize; stepRetention now logs the applied policy with template/source details. Updated unit tests to cover the regression and logging, and updated changelog entries.
Close and destroy read streams to prevent FD leaks that left temporary .tar files holding disk blocks indefinitely. Updated tar-utils to keep createReadStream instances in variables and destroy them on error, and wrapped stream usage in FTP, S3, SFTP and OneDrive adapters with try/finally blocks that call fileStream.destroy(). Also updated changelog to document the fix (addresses #100). This ensures uploaded/processed temporary files are released promptly and avoids ghost disk usage.
Cache and reuse the SFTP session in the MSSQL SSH transfer adapter instead of opening a new SFTP channel on every operation. Add a sftpSession field, return the cached session from getSftp(), and explicitly end() the session in end() before disconnecting. Also update the changelog to document the bug fix (avoids exhausting SSH server channel limits such as OpenSSH's default 10, which caused "Channel open failure: open failed" and aborted backups when processing many databases).
Streamline docs/changelog.md entries into concise bullet lines, correct the retention term from GVS to GFS across changelog text, and update test and improvement notes for SMB, retention, storage, and history. Modify prisma/migrations/20260527000001_fix_gfs_retention_name/migration.sql to add a guard (NOT EXISTS) and comment so the built-in retention rename to 'Smart GFS (7/4/12/2)' skips if that target name already exists, preventing a unique-constraint failure.
Bump project and docs versions to 2.4.1 (package.json, docs/package.json, api-docs/openapi.yaml, public/openapi.yaml) and update changelog/Docker tags for the release. Fix broken FTP/SFTP unit tests by adding destroy: vi.fn() to fs.createReadStream mocks so adapters that call fileStream.destroy() in finally blocks no longer throw TypeError.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.