RocketChat / RocketChat/Rocket.Chat

RC 5.4.8: Web UI not loading after OAuth login due to "uncaught promises"

Open
#29,031 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

I have a custom OAuth implementation. After logging in on the auth provider, I get redirected back to RC and hear the welcome sound, but I only see the three animated dots and do not get a chat interface.

Reloading the chat fixes the problem.

Steps to reproduce:

Not sure if this is reproducible with a plain RocketChat outside our special setup.

  1. Have a RocketChat instance with a custom OAuth provider (PHP-based, using league/oauth2-server as the base)
  2. Open the chat, click the button "Login via "
  3. Log in with the identity provider, get redirected back to the chat
  4. See the chat open, but breaking with the three animated dots
  5. The browser console shows uncaught exceptions in promises:

image

Expected behavior:

Chat opens normally.

Actual behavior:

Three animated dots, in the console I see uncaught exceptions within promises.

I tried tracing the exceptions to their unminified source, and I think it's these two places:

Server Setup Information:
  • Version of Rocket.Chat Server: 5.4.8
  • Operating System: Ubuntu w/ Docker 23.0.3
  • Deployment Method: Docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: Enabled
  • NodeJS Version: 14.19.3
  • MongoDB Version: 5.0.16
  • Commit Hash: cda0b40a3c
Client Setup Information
  • Desktop App or Browser Version: Firefox 112 and Chrome 10x
  • Operating System: Ubuntu 22.04
Additional context
Relevant logs:

Stacktrace from Chrome for the rocketchat:streamer error:

onStop @ 63326d8399da4bede896e472cb4d732145c62c84.js?meteor_js_resource=true:1458
_livedata_nosub @ 63326d8399da4bede896e472cb4d732145c62c84.js?meteor_js_resource=true:1366
onMessage @ 63326d8399da4bede896e472cb4d732145c62c84.js?meteor_js_resource=true:1366
(anonymous) @ 63326d8399da4bede896e472cb4d732145c62c84.js?meteor_js_resource=true:1336
forEachCallback @ 63326d8399da4bede896e472cb4d732145c62c84.js?meteor_js_resource=true:1336
socket.onmessage @ 63326d8399da4bede896e472cb4d732145c62c84.js?meteor_js_resource=true:1336
r.dispatchEvent @ 63326d8399da4bede896e472cb4d732145c62c84.js?meteor_js_resource=true:1336
k._dispatchMessage @ 63326d8399da4bede896e472cb4d732145c62c84.js?meteor_js_resource=true:1336
k._didMessage @ 63326d8399da4bede896e472cb4d732145c62c84.js?meteor_js_resource=true:1336
o.ws.onmessage @ 63326d8399da4bede896e472cb4d732145c62c84.js?meteor_js_resource=true:1336

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with apps/meteor/app/notifications/client/lib/Notifications.js at the referenced line, then trace the client rocketchat:streamer subscribe() failure using the browser console and stack trace. Reproduce the custom OAuth redirect if possible; done means the chat interface loads normally after login without uncaught promise exceptions.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, php, typescript
Domain
authentication, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.