Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use oc-etag instead of etag #6952

Merged
merged 2 commits into from
May 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Bugfix: Use OC-ETag instead of ETag in text editor app

We've fixed a bug, where the ETag instead of OC-ETag in the text editor app was used,
due to server encoding, the ETag might be manipulated and contain the gzip suffix on a large text file.
Saving the respective file, might cause an error, as the sent ETag doesn't match the server's ETag.

https://github.com/owncloud/web/pull/6952
https://github.com/owncloud/web/issues/6947
https://github.com/owncloud/web/issues/4605
5 changes: 2 additions & 3 deletions packages/web-app-text-editor/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default {
.getFileContents(filePath)
.then((response) => {
serverContent.value = currentContent.value = response.body
currentETag.value = response.headers.ETag
currentETag.value = response.headers['OC-ETag']
return response
})
}).restartable()
Expand All @@ -116,8 +116,7 @@ export default {
.then(
(response) => {
serverContent.value = newContent
// FIXME: above we need response.headers.ETag, here we need response ETag - feels inconsistent
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: I removed this comment, as it is intended, above we do a get request to a file (where the headers should contain the etag), while updating a resource the etag is emitted in the payload, which is correct

currentETag.value = response.ETag
currentETag.value = response['OC-ETag']
},
(error) => {
switch (error.statusCode) {
Expand Down
2 changes: 1 addition & 1 deletion packages/web-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"marked": "^4.0.12",
"oidc-client": "1.11.5",
"owncloud-design-system": "^13.1.0-rc.5",
"owncloud-sdk": "~3.0.0-alpha.8",
"owncloud-sdk": "~3.0.0-alpha.9",
"p-queue": "^6.1.1",
"popper-max-size-modifier": "^0.2.0",
"portal-vue": "^2.1.7",
Expand Down
13 changes: 8 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9635,9 +9635,9 @@ __metadata:
languageName: node
linkType: hard

"owncloud-sdk@npm:~3.0.0-alpha.8":
version: 3.0.0-alpha.8
resolution: "owncloud-sdk@npm:3.0.0-alpha.8"
"owncloud-sdk@npm:~3.0.0-alpha.9":
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry to be picky here but #6952 should be linked in the "sdk-bump" changelog item then 😬 can be done after this has been merged in a changelog-only PR though (which skips all the tests in CI)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See: #6956

version: 3.0.0-alpha.9
resolution: "owncloud-sdk@npm:3.0.0-alpha.9"
peerDependencies:
axios: ^0.26.0
cross-fetch: ^3.0.6
Expand All @@ -9647,7 +9647,10 @@ __metadata:
uuid: ^8.2.0
webdav: 4.9.0
xml-js: ^1.6.11
checksum: 96e09c641010a9356bba63e5fe8aa259cf54279a8bb2c3ae81653f5d9e5598acd4050be707477229c6e53cd7c9d798d451c455182e0160d452738249ecf03c63
dependenciesMeta:
"@pact-foundation/pact":
built: true
checksum: 4ef6bcfc68c59739d40f09c18d34a9116e3e24930e3f659c0738900c6e00cf68c09083012da1deb619b31dbd7561d83006ca9c0fa120068bcd26409029b982f9
languageName: node
linkType: hard

Expand Down Expand Up @@ -13692,7 +13695,7 @@ __metadata:
marked: ^4.0.12
oidc-client: 1.11.5
owncloud-design-system: ^13.1.0-rc.5
owncloud-sdk: ~3.0.0-alpha.8
owncloud-sdk: ~3.0.0-alpha.9
p-queue: ^6.1.1
popper-max-size-modifier: ^0.2.0
portal-vue: ^2.1.7
Expand Down