REPRODUCIBILITY: 100 %
OS VERSION: 5.2.0.22
HARDWARE: Jolla Phone 2026
UI LANGUAGE: French
REGRESSION: Yes, since Microsoft retired the Live Connect API (apis.live.net); backups to personal accounts probably never worked
DESCRIPTION:
Three OneDrive problems, all reproducible. I found the causes and have fixes running on my device.
1. Backups to a personal OneDrive account always fail. Settings → Backup → Back up now always ends with “Error: unable to transfer the file”. Work/school (Entra ID) accounts work.
Cause: buteo-sync-plugins-social sends Authorization: Bearer with the chunk PUT requests to the pre-authenticated uploadUrl of the upload session. Consumer OneDrive answers 401 Unauthenticated, as Microsoft’s documentation warns; OneDrive for Business tolerates it.
Fix: pull request onedrive: Do not send Authorization header with upload session chunks by Creteil · Pull Request #23 · sailfishos/buteo-sync-plugins-social · GitHub (2 lines).
2. New OneDrive accounts have no name, and the same account can be added several times. Accounts shows no user name. Backup shows every OneDrive account as just “OneDrive”, so with two of them you cannot tell which is which. The duplicate check in onedrive.qml (“You have already added a OneDrive account for user %1”) never triggers.
Cause: after sign-in, /usr/share/accounts/ui/onedrive.qml identifies the user with https://apis.live.net/v5.0/me. That is the retired Live Connect API, which now returns HTTP 400. On a non-200 reply the code continues (accountSetup.done()), so:
default_credentials_usernameanddefault_credentials_idare never set: no account name. The Backup page builds its label “OneDrive (name)” from that user name.- The duplicate check compares the empty
default_credentials_id, so it never matches. - An anonymous account is created silently.
3. Adding a OneDrive account silently signs in with whatever Microsoft session the Sailfish Browser has (e.g. a work account used in the browser). The intended account cannot be chosen, and you get a duplicate of the other account.
Cause: onedrive.provider uses ExternalBrowser = true, and the authorization request has no prompt parameter.
PRECONDITIONS:
- A personal Microsoft account (for 1).
- For 3: a Microsoft session already open in the Sailfish Browser, for another account.
STEPS TO REPRODUCE:
- Settings → Accounts → Add account → OneDrive, sign in with a personal Microsoft account.
- Look at the new account in Accounts and in Settings → Backup.
- Settings → Backup → Back up now to this account.
- Add OneDrive again with the same Microsoft account.
EXPECTED RESULT:
- The account shows its user name in Accounts and Backup.
- The backup completes.
- Adding the same account again is refused.
- Microsoft lets me choose which account to sign in with.
ACTUAL RESULT:
- No name: just “OneDrive”, in both places.
- The backup fails with “unable to transfer the file”. The journal shows
HTTP code: 401 ... "unauthenticated"frombuteo-oopp-runner. - A second, identical, nameless account is created.
- With a Microsoft session in the browser, it signs in with that account without asking.
MODIFICATIONS:
- Patchmanager: yes, my own patch of
onedrive.qmlto test the fix for 2 and 3 (described below). The problems were reproduced before it was installed. buteo-sync-plugins-social0.4.33 rebuilt with the change from the PR above.
ADDITIONAL INFORMATION:
Suggested fix for 2 and 3. This is what my Patchmanager patch of onedrive.qml does, tested on 5.2.0.22:
- A page asks for the Microsoft account address before opening the browser. An address already used by a OneDrive account is refused there.
- The sign-in session uses what
signon-plugin-oauth2already supports:ExtraParams, added by Jolla in 2022 so that Microsoft prompts for the account. It also adds theUser.Readscope:
var sessionData = {
"ClientId": ...,
"ClientSecret": ...,
"Scope": ["offline_access", "files.readwrite", "User.Read"],
"ExtraParams": { "prompt": "select_account", "login_hint": email }
}
- After sign-in, the user is identified with Microsoft Graph
GET https://graph.microsoft.com/v1.0/me(id,mail/userPrincipalName). The new account is removed, with an error shown, if:- Graph fails;
- the signed-in address differs from the one typed;
- the Microsoft user id already belongs to another OneDrive account.
default_credentials_id, the address and a display label are stored. Accounts and Backup now show the same name.
Results:
- Personal and work accounts both work, side by side, each with its own name, and with an account picker instead of silent sign-in.
- The same address is refused before any browser opens.
- Backups to the personal account complete, together with the PR above.
I can share the Patchmanager patch if useful. Ideally these changes would go into jolla-settings-accounts-extensions-onedrive.