Closed Bug 1328218 Opened 7 years ago Closed 7 years ago

Jira completely broken (moment)

Categories

(Core :: JavaScript Engine, defect)

53 Branch
x86_64
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
firefox51 --- unaffected
firefox52 --- unaffected
firefox53 blocking verified

People

(Reporter: contact, Unassigned)

References

Details

(Keywords: nightly-community, regression)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:53.0) Gecko/20100101 Firefox/53.0
Build ID: 20170102030204

Steps to reproduce:

- Login into Jira v7.2.2
- Try to open some menu


Actual results:

- Nothing
- Only the header/footer are ok
- Nothing more
- Having many errors into the console (TypeError: moment is undefined)


Expected results:

- Menus should work
- Content should be there
OS: Unspecified → Mac OS X
Hardware: Unspecified → x86_64
Everything works fine into Firefox 50.1.0 and Firefox 52.0a2 DE.
Confirmed on a demo instance of Jira at https://jira.atlassian.com/
Status: UNCONFIRMED → NEW
Ever confirmed: true
INFO: Last good revision: 732548de4aadf0e6d51d3eac109135478176a986
14:15.35 INFO: First bad revision: 00fde28274fa2afb2bdaacc9152046269c7e9db8
14:15.35 INFO: Pushlog:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=732548de4aadf0e6d51d3eac109135478176a986&tochange=00fde28274fa2afb2bdaacc9152046269c7e9db8

Jeff, all the commits in the regression range are yours, could you have a look please? Thanks
Flags: needinfo?(jwalden+bmo)
Keywords: regression
Sigh.  Jira appears to be using an ancient version of the momentjs library, that improperly feature-detects Node as being anything with a "global" global property.  The moment folks fixed this in https://github.com/moment/moment/commit/1601cb1dd7b14277ba8b00cb2ece3ce637923080 which Jira seems not to have started using yet.

Unless latest Jira's updated their moment version (which seems doubtful, as you'd think they'd demo the latest version), this may end up being the straw that broke the camel's back on immediately shipping a "global" property on the global object.  We can get Jira to fix, certainly, but then we'd have to wait on the rollout to customers, and I expect that would take a fairly long period of time.  But who knows.  I'll at least marki the dep before lunchtime.  :-)
Blocks: globalThis
Flags: needinfo?(jwalden+bmo)
(In reply to Jeff Walden [:Waldo] (remove +bmo to email) from comment #4)
> Sigh.  Jira appears to be using an ancient version of the momentjs library,
> that improperly feature-detects Node as being anything with a "global"
> global property.  The moment folks fixed this in
> https://github.com/moment/moment/commit/
> 1601cb1dd7b14277ba8b00cb2ece3ce637923080 which Jira seems not to have
> started using yet.
> 
> Unless latest Jira's updated their moment version (which seems doubtful, as
> you'd think they'd demo the latest version), this may end up being the straw
> that broke the camel's back on immediately shipping a "global" property on
> the global object.  We can get Jira to fix, certainly, but then we'd have to
> wait on the rollout to customers, and I expect that would take a fairly long
> period of time.  But who knows.  I'll at least marki the dep before
> lunchtime.  :-)

Shouldn't the original line - `globalScope = typeof global !== 'undefined' ? global : this` - continue to properly set `globalScope` to the global object, since `global` is that?
|this| here is not the window! They call that function that contains this snippet like this:
function () {
var z = {};
A.call(z);
return z.moment
}

So before A would define moment on the z object, now it's being defined on the global.
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Ah, I didn't expect anyone would want to do that. Thanks for explaining.
Jeff, I think we should disable this feature until jira fixed the issue and made a new release.
Otherwise, we are going to lose users to our competitors. We should synchronize with our competitors on enabling this new feature.

Could you please disable the global keyword or backout the changes? 
Thanks
Flags: needinfo?(jwalden+bmo)
It has been backed out already, see bug 1317422 comment 17.
Flags: needinfo?(jwalden+bmo)
OK, thanks. We should close this bug when we will have a nightly with the backout;

By the way, did we report a bug to jira to make sure that they update their version of moment?
Hi, random drive-by comment from The Internet. I've created an issue with JIRA about this so that it's publicly tracked somewhere: https://jira.atlassian.com/browse/JRA-63750
Safari Technology Preview 21 was just released with `global` support. JIRA v6.2 seems to be working fine for me.

https://i.imgur.com/8Hh8WnV.png
JIRA 6.2 is too old to show the bug (it was released in early 2014). Viewing jira.atlassian.com (JIRA version 7.3) in Safari Technology Preview 21 fails for me.
(In reply to Sylvestre Ledru [:sylvestre] from comment #11)
> OK, thanks. We should close this bug when we will have a nightly with the
> backout;

This was backed out in https://bugzilla.mozilla.org/show_bug.cgi?id=1317422#c19 (2 weeks ago). Simounet can you confirm it works in the latest Nightly and close if so?
Status: NEW → RESOLVED
Closed: 7 years ago
Flags: needinfo?(contact)
Resolution: --- → FIXED
I can confirm this is fixed. Thanks!
Flags: needinfo?(contact)
You need to log in before you can comment on or make changes to this bug.