Skip to content

Commit

Permalink
fix: bump deps, cleanup streams, unlink to trash
Browse files Browse the repository at this point in the history
  • Loading branch information
Dwynr committed Aug 18, 2024
1 parent 05ac983 commit 130fd30
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@filen/webdav",
"version": "0.2.30",
"version": "0.2.31",
"description": "Filen WebDAV",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -52,7 +52,7 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@filen/sdk": "^0.1.153",
"@filen/sdk": "^0.1.154",
"body-parser": "^1.20.2",
"dayjs": "^1.11.11",
"express": "^4.19.2",
Expand Down
4 changes: 2 additions & 2 deletions src/handlers/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class Copy {
if (overwrite && destinationResource && !destinationResource.isVirtual) {
await sdk.fs().unlink({
path: destinationResource.path,
permanent: true
permanent: false
})

this.server.getVirtualFilesForUser(req.username)[destination] = {
Expand Down Expand Up @@ -135,7 +135,7 @@ export class Copy {
if (overwrite && destinationResource) {
await sdk.fs().unlink({
path: destinationResource.path,
permanent: true
permanent: false
})

await sdk.fs().cp({
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class Delete {

await sdk.fs().unlink({
path: resource.path,
permanent: true
permanent: false
})

await Responses.ok(res)
Expand Down
2 changes: 2 additions & 0 deletions src/handlers/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ export class Get {

const cleanup = () => {
try {
stream.cancel().catch(() => {})

if (!nodeStream.closed && !nodeStream.destroyed) {
nodeStream.destroy()
}
Expand Down
4 changes: 2 additions & 2 deletions src/handlers/move.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class Move {
if (overwrite && destinationResource && !destinationResource.isVirtual) {
await sdk.fs().unlink({
path: destinationResource.path,
permanent: true
permanent: false
})

this.server.getVirtualFilesForUser(req.username)[destination] = {
Expand Down Expand Up @@ -139,7 +139,7 @@ export class Move {
if (overwrite && destinationResource) {
await sdk.fs().unlink({
path: destinationResource.path,
permanent: true
permanent: false
})

await sdk.fs().rename({
Expand Down

0 comments on commit 130fd30

Please sign in to comment.