Page MenuHomePhorge

"TypeError: config.datasets is undefined" in Facts when logged out
Closed, ResolvedPublic

Description

Note: I can only reproduce this on we.phorge.it and not on my local instance.

Steps to reproduce:

  1. Go to https://we.phorge.it/project/reports/71/ when not being logged in

Expected outcome:

  • either a burndown chart is rendered
  • or some message explains why it is not rendered
  • or you do get redirected to a Login dialog, like on my local test instance which is set to Can Use Application: All Users

Actual outcome:

  • Blank boxes.
  • Opening https://we.phorge.it/fact/chart/somestringhere/draw/ directly, it shows some payload including \"\u003eYou must log in to take this action.\u003c\/p\u003e\u003c\/div\u00
  • Selecting the View Chart button in the upper right corner does redirect you to a log-in page.
  • Or if the Can Use Application policy at /applications/view/PhabricatorFactApplication/ does not include the currently logged in user, show something else than blank boxes, e.g. in this case, View Chart says You Shall Not Pass: Restricted Application

In Javascript error log:

TypeError: config.datasets is undefined
    _redraw https://we.phorge.it/res/defaultX/phabricator/52e3ff03/rsrc/js/application/fact/Chart.js:18
    setData https://we.phorge.it/res/defaultX/phabricator/52e3ff03/rsrc/js/application/fact/Chart.js:1
    onresponse https://we.phorge.it/res/defaultX/phabricator/ad258e28/rsrc/js/application/maniphest/behavior-line-chart.js:5
    listen https://we.phorge.it/res/defaultX/phabricator/66c49ca1/core.pkg.js:80
    pass https://we.phorge.it/res/defaultX/phabricator/66c49ca1/core.pkg.js:164
    _dispatchProxy https://we.phorge.it/res/defaultX/phabricator/66c49ca1/core.pkg.js:159
    invoke https://we.phorge.it/res/defaultX/phabricator/66c49ca1/core.pkg.js:102
    invoke https://we.phorge.it/res/defaultX/phabricator/66c49ca1/core.pkg.js:78
    _done https://we.phorge.it/res/defaultX/phabricator/66c49ca1/core.pkg.js:248
    when_complete https://we.phorge.it/res/defaultX/phabricator/66c49ca1/core.pkg.js:252
    _complete https://we.phorge.it/res/defaultX/phabricator/66c49ca1/core.pkg.js:209
    setTimeout handler*load https://we.phorge.it/res/defaultX/phabricator/66c49ca1/core.pkg.js:197
    _handleResponse https://we.phorge.it/res/defaultX/phabricator/66c49ca1/core.pkg.js:252
    _onreadystatechange https://we.phorge.it/res/defaultX/phabricator/66c49ca1/core.pkg.js:236
    send https://we.phorge.it/res/defaultX/phabricator/66c49ca1/core.pkg.js:229
    <anonymous> https://we.phorge.it/res/defaultX/phabricator/ad258e28/rsrc/js/application/maniphest/behavior-line-chart.js:6
    initBehaviors https://we.phorge.it/res/defaultX/phabricator/66c49ca1/core.pkg.js:194
    initialize https://we.phorge.it/res/defaultX/phabricator/66c49ca1/core.pkg.js:169
    __rawEventQueue https://we.phorge.it/res/defaultX/phabricator/98e6504a/rsrc/externals/javelin/core/init.js:15
    <anonymous> https://we.phorge.it/res/defaultX/phabricator/98e6504a/rsrc/externals/javelin/core/init.js:28
    EventListener.handleEvent* https://we.phorge.it/res/defaultX/phabricator/98e6504a/rsrc/externals/javelin/core/init.js:28
    <anonymous> https://we.phorge.it/res/defaultX/phabricator/98e6504a/rsrc/externals/javelin/core/init.js:29

Event Timeline

From a quick glance, looks like the ajax for the graph content is returning a login form or a js redirect request (with status 200), and the handling code in the report page doesn't properly handle that.

The page is labeled "prototype", so I'm not surprised it doesn't work properly in some edge-cases.

In this case, probably the access check for the graph content in incorrect - it should match exactly the rest of the page, which is public here.