Skip to content

Commit 3607aff

Browse files
Allow webapp file creation on IRIS servers lacking the DP-442552 fix (#1768)
1 parent 6ada70a commit 3607aff

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/providers/FileSystemProvider/FileSystemProvider.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,13 @@ export function generateFileContent(
155155
eol,
156156
};
157157
}
158+
} else if (csp && sourceContent.length == 0) {
159+
// Some IRIS versions do not allow empty content to be PUT for CSP files, so add a newline if the content is empty. See DP-442552.
160+
return {
161+
content: [""],
162+
enc: false,
163+
eol,
164+
};
158165
}
159166
return {
160167
content: base64EncodeContent(Buffer.from(sourceContent)),
@@ -606,15 +613,15 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
606613
// Create content (typically a stub, unless the write-phase of a copy operation).
607614
const newContent = generateFileContent(uri, fileName, content);
608615

609-
// Write it to the server
616+
// Write it to the server, ignoring conflict report that some IRIS versions incorrectly give
610617
return api
611618
.putDoc(
612619
fileName,
613620
{
614621
...newContent,
615622
mtime: Date.now(),
616623
},
617-
false
624+
true
618625
)
619626
.catch((error) => {
620627
// Throw all failures

0 commit comments

Comments
 (0)