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

Mastodon 2.7.2 frontend crashes on DM column load #10068

Closed
Luzifer opened this issue Feb 17, 2019 · 9 comments
Closed

Mastodon 2.7.2 frontend crashes on DM column load #10068

Luzifer opened this issue Feb 17, 2019 · 9 comments

Comments

@Luzifer
Copy link

Luzifer commented Feb 17, 2019

Expected behaviour

  • Frontend is loading properly and does not crash

Actual behaviour

  • Frontend loads most of the content and then crashes

Steps to reproduce the problem

  • ... not fully clear ...
  • Update instance from 2.7.1 to 2.7.2
  • Reload the web-ui
  • UI loads Home, Notifications, Local and List column, DM column is empty
  • Interface crashes and a blank screen is left

Specifications

  • Tested in
    • Windows 10, Chrome Beta 73
    • Linux, Chrome Beta 73
    • Linux, Chrome Stable 72
    • Linux, Firefox 65
  • According to dev-tools (source map used) crash occurs in index.js#L137 when trying to call getWrappedInstance on null object.
     react-dom.production.min.js:179 TypeError: Cannot read property 'get' of undefined
         at t.render (display_name.js:31)
         at co (react-dom.production.min.js:163)
         at so (react-dom.production.min.js:162)
         at po (react-dom.production.min.js:169)
         at $o (react-dom.production.min.js:204)
         at Yo (react-dom.production.min.js:205)
         at Ni (react-dom.production.min.js:220)
         at Ii (react-dom.production.min.js:219)
         at xi (react-dom.production.min.js:216)
         at ti (react-dom.production.min.js:214)
     [...]
     react-dom.production.min.js:179 TypeError: Cannot read property 'getWrappedInstance' of null
         at application-f86408ab580b14c099f7.js:formatted:1001
         at wo (react-dom.production.min.js:179)
         at Oo (react-dom.production.min.js:182)
         at So (react-dom.production.min.js:187)
         at Di (react-dom.production.min.js:226)
         at Ni (react-dom.production.min.js:220)
         at Ii (react-dom.production.min.js:219)
         at xi (react-dom.production.min.js:216)
         at ti (react-dom.production.min.js:214)
         at Object.enqueueSetState (react-dom.production.min.js:134)
     [...]
     alerts.js:46 TypeError: Cannot read property 'get' of undefined
         at t.render (display_name.js:31)
         at co (react-dom.production.min.js:163)
         at so (react-dom.production.min.js:162)
         at po (react-dom.production.min.js:169)
         at $o (react-dom.production.min.js:204)
         at Yo (react-dom.production.min.js:205)
         at Ni (react-dom.production.min.js:220)
         at Ii (react-dom.production.min.js:219)
         at xi (react-dom.production.min.js:216)
         at ti (react-dom.production.min.js:214)
    
  • Sadly I was not able to find out what exactly caused that issue due to the limitations of Chrome dev tools in combination with minified production code.
  • Assumption is there might be some older and likely broken DM conversation which causes trouble with the changes from 2.7.1 to 2.7.2.
@Luzifer
Copy link
Author

Luzifer commented Feb 17, 2019

In the meantime I might have found the reason:

I do have one DM thread with an empty array for accounts:

{
  "id": "11307",
  "unread": false,
  "accounts": [],
  "last_status": {
    "id": "101063429786697282",
    "created_at": "2018-11-13T10:39:17.127Z",
// --- Shortened
    "mentions": [],
    "tags": [],
    "emojis": [],
    "card": null
  }
}

When using the first() element of an empty array this might cause trouble.

Edit: Confirmed the above. This was the reason: A single DM I sent to another user. After deleting that particular status the interface is loading again properly.

@ghost
Copy link

ghost commented Feb 18, 2019

Same thing at mastodont.cat after updating to v2.7.2. When I reply to a direct message the interface goes blank
captura de pantalla 2019-02-18 a les 18 58 32
cc @Gargron

@ghost
Copy link

ghost commented Feb 18, 2019

Downgraded to v2.7.1 for now.

@ClearlyClaire
Copy link
Contributor

It seems to me it can occur whenever none of the participants of a conversation exist anymore.

ClearlyClaire added a commit to ClearlyClaire/mastodon that referenced this issue Feb 19, 2019
Gargron pushed a commit that referenced this issue Feb 19, 2019
* Never return empty participants for conversations

Fixes #10068

* Fix client-side crash when conversations have no participants
@leahoswald
Copy link

Is there a planned bugfix release for that issue? We have multiple users affected by the problem, so it would be great if we could fix it without patching it manually.

@angristan
Copy link
Contributor

angristan commented Feb 23, 2019

Agreed, if have some users that can't use the front-end at all, so it would be great if they didn't have too wait for too long 😥

Edit: If other admins don't want to run on master either, you can manually apply the patch with:

wget https://patch-diff.githubusercontent.com/raw/tootsuite/mastodon/pull/10078.patch
git apply 10078.patch

@ghost
Copy link

ghost commented Feb 23, 2019

@nazco they already fixed it. You can apply the patch as mentioned by @angristan.
Already did myself and it works just fine.

@angristan
Copy link
Contributor

@salvadorpla The fix is in master and not in a release so basically 0 instance currently have it

@ghost
Copy link

ghost commented Feb 23, 2019

@angristan yes, I edited the affected files and then recompiled assets. Done.

Gargron pushed a commit that referenced this issue Feb 23, 2019
* Never return empty participants for conversations

Fixes #10068

* Fix client-side crash when conversations have no participants
hiyuki2578 pushed a commit to ProjectMyosotis/mastodon that referenced this issue Oct 2, 2019
* Never return empty participants for conversations

Fixes mastodon#10068

* Fix client-side crash when conversations have no participants
messenjahofchrist pushed a commit to Origin-Creative/mastodon that referenced this issue Jul 30, 2021
* Never return empty participants for conversations

Fixes mastodon#10068

* Fix client-side crash when conversations have no participants
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

4 participants