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

OWA: Login failing in the background #213

Open
jermy-c opened this issue Sep 18, 2024 · 5 comments
Open

OWA: Login failing in the background #213

jermy-c opened this issue Sep 18, 2024 · 5 comments
Assignees

Comments

@jermy-c
Copy link
Collaborator

jermy-c commented Sep 18, 2024

Reproduction

  1. Setup a @outlook.com account in Mustang with the OWA protocol
  2. Click next

Actual Result

  1. Login fails in the background
  2. Console has error

Expected Result

  1. No login failure in the background
  2. Console has no error

Stack

{
    "id": 1241,
    "success": false,
    "message": "Unexpected end of JSON input",
    "backendStack": "SyntaxError: Unexpected end of JSON input\n    at JSON.parse (<anonymous>)\n    at parseJSONFromBytes (node:internal/deps/undici/undici:5472:19)\n    at successSteps (node:internal/deps/undici/undici:5454:27)\n    at fullyReadBody (node:internal/deps/undici/undici:4381:9)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async consumeBody (node:internal/deps/undici/undici:5463:7)\n    at async fetchJSON (file:///Users/jeremyc/Documents/GitHub/mustang/e2/out/main/index.js:126465:17)\n    at async JPCWebSocket.callListener (file:///Users/jeremyc/Documents/GitHub/mustang/e2/out/main/index.js:46167:16)\n    at async WSCall._incomingMessage (file:///Users/jeremyc/Documents/GitHub/mustang/e2/out/main/index.js:45750:20)\n    at async WebSocket.<anonymous> (file:///Users/jeremyc/Documents/GitHub/mustang/e2/out/main/index.js:45844:9)",
    "originalCall": {
        "id": 1241,
        "path": "call",
        "arg": {
            "obj": "38016196030746509312",
            "args": [
                "persist:login:account51",
                "https://outlook.live.com/owa/0/ev.owa2?ns=PendingRequest&ev=FinishNotificationRequest&UA=0"
            ]
        }
    }
}

Console Error

Error: Unexpected end of JSON input
    at message.js:153:16
    at new Promise (<anonymous>)
    at WSCall.makeCall (message.js:148:12)
    at JPCWebSocket.callRemote (protocol.js:161:31)
    at Object.fetchJSON (obj.js:198:55)
    at OWAAccount.listenForEvents (OWAAccount.ts:234:52)
    at OWAAccount.login (OWAAccount.ts:120:10)
    at async OWAAccount.verifyLogin (Account.ts:66:5)
    at async checkConfig (checkConfig.ts:8:5)
    at async CheckConfig.svelte:19:3

Related bug:

@jermy-c jermy-c self-assigned this Sep 18, 2024
@benbucksch
Copy link
Collaborator

I see the same

@jermy-c
Copy link
Collaborator Author

jermy-c commented Sep 18, 2024

This also produces Cannot read properties of null (reading 'ParentFolder') error, mentioned in #198 (comment)

Reproduction

  1. Setup a @outlook.com account in Mustang with the OWA protocol
  2. Click next

Actual Result

  1. Error shows in the UI
  2. You can click next and it is as if there was no error
圖片

@jermy-c
Copy link
Collaborator Author

jermy-c commented Sep 19, 2024

Error: Unexpected end of JSON input

The response OWAAccount.listenForEvents from the fetch request is a body that is empty and reponse.json() from fetchJSON() is trying to parse an empty string.

@jermy-c
Copy link
Collaborator Author

jermy-c commented Sep 24, 2024

Ocassionally findFolders.Body.ResponseMessages.Items[0] is:

{
    "__type": "FindFolderResponseMessage:#Exchange",
    "RootFolder": null,
    "MessageText": "Too many concurrent connections opened., Cannot open mailbox. Server = BLAPR06MB6804.namprd06.prod.outlook.com, mdbGuid = 5e4a2f79-001e-4ea5-8c24-2bcb92742c95, maiboxGuid = 0003bffe-84b6-c7f5-0000-000000000000",
    "ResponseCode": "ErrorTooManyObjectsOpened",
    "ResponseClass": "Error"
}

causing the Cannot read properties of null (reading 'ParentFolder') error which means it might be a different issue.

Possible solutions:

  1. Check if the RootFolder is null and call listFolder() after a 1 sec delay
  2. Check if there's too many connections to the server
  3. Check if there's already a connection being made or if listFolder() was called before and only allow one connection at a time for an account.

@NeilRashbrook
Copy link
Collaborator

We have checks for too many connections in #159... but unfortunately those checks didn't apply to the session data call, so I rebased the branch and added the extra checking.

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

No branches or pull requests

3 participants