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

Always send a language header in all requests #10619

Closed
2 tasks done
michaelstingl opened this issue Mar 21, 2023 · 5 comments · Fixed by #11020
Closed
2 tasks done

Always send a language header in all requests #10619

michaelstingl opened this issue Mar 21, 2023 · 5 comments · Fixed by #11020
Assignees
Labels
p3-medium Normal priority
Milestone

Comments

@michaelstingl
Copy link
Contributor

michaelstingl commented Mar 21, 2023

Pre-submission Checks

  • I checked for similar issues, but could not find any. I also checked the closed issues. I could not contribute additional information to any existing issue.
  • I will take the time to fill in all the required fields. I know that the bug report may be dismissed otherwise due to lack of information.

Feature description

Latest oCIS notifications API (/ocs/v2.php/apps/notifications/api/v1/notifications?format=json) responds with translated content. Other endpoints will learn this too.

Proposed solution

Desktop app should always send a language header in all requests which follows the Accept-Language spec:

Alternative solutions you considered

No response

Additional context

Related:

@TheOneRing
Copy link
Contributor

I would only enable that on a per endpoint basis, I don't know where we parse random strings and thus "only speak English"

@michaelstingl michaelstingl added p3-medium Normal priority and removed p2-high Escalation, on top of current planning, release blocker labels Apr 13, 2023
@michaelstingl
Copy link
Contributor Author

I would only enable that on a per endpoint basis, I don't know where we parse random strings and thus "only speak English"

Better send same to all endpoints.

@fmoc
Copy link
Contributor

fmoc commented Jun 23, 2023

Note: @TheOneRing thinks there might be at least one location where we actually parse an error message from the server (somewhere in the common error handling). We may need to either replace this with a more reliable solution (if possible) or force an English locale in Accept-Language for these requests explicitly.

@fmoc fmoc assigned erikjv and unassigned erikjv Jun 23, 2023
@TheOneRing
Copy link
Contributor

case 503: {
// When the server is in maintenance mode, we want to exit the sync immediatly
// so that we do not flood the server with many requests
// BUG: This relies on a translated string and is thus unreliable.
// In the future it should return a NormalError and trigger a status.php
// check that detects maintenance mode reliably and will terminate the sync run.
auto probablyMaintenance =
errorBody.contains(R"(>Sabre\DAV\Exception\ServiceUnavailable<)")
&& !errorBody.contains("Storage is temporarily not available");
return probablyMaintenance ? SyncFileItem::FatalError : SyncFileItem::NormalError;

@HanaGemela
Copy link
Contributor

Passed ownCloud 5.0.0.11523-alpha.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3-medium Normal priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants