mozilla / addons

☂ Umbrella repository for Mozilla Addons ✨
Other
125 stars 41 forks source link

Code Manager fails on .ts #7834

Closed erosman closed 4 years ago

erosman commented 4 years ago

Example:

https://code.addons.mozilla.org/en-US/compare/764197/versions/2266957...4859565/?allowSlowPages=true&path=scripts%2FInputArea%2FContentEditable.ts
https://reviewers.addons.mozilla.org/en-US/firefox/files/browse/3403941/file/scripts/InputArea/ContentEditable.ts#top

Code manger displays:

Syntax highlighting was disabled for performance
+++ 0--- 0

Legacy File Viewer displays:

module GhostText.InputArea {
--
  | /**
  | * Implementation for a contenteditable element.
  | *
  | * @licence The MIT License (MIT)
  | * @author Guido Krömer <mail 64 cacodaemon 46 de>
  | */
  | export class ContentEditable implements IInputArea {

.....

Same file without compare:

https://code.addons.mozilla.org/en-US/browse/764197/versions/4859565/?path=scripts%2FInputArea%2FContentEditable.ts
https://reviewers.addons.mozilla.org/en-US/firefox/files/browse/3403941/file/scripts/InputArea/ContentEditable.ts

Code manger displays: (nothing, blank)

Legacy File Viewer displays:

module GhostText.InputArea {
--
  | /**
  | * Implementation for a contenteditable element.
  | *
  | * @licence The MIT License (MIT)
  | * @author Guido Krömer <mail 64 cacodaemon 46 de>
  | */
  | export class ContentEditable implements IInputArea {

.....
willdurand commented 4 years ago

This looks serious

willdurand commented 4 years ago

The server sets the wrong mimetype to this file (and all other .ts files). I am not sure why we don't serve the content yet but that could be the reason.

wagnerand commented 4 years ago

In the API response hunks is empty. Also

mimetype | "video/MP2T"
mime_category | "binary"
ioanarusiczki commented 4 years ago

@willdurand I could view the .ts files on dev - FF78(Win10). Browse view Compare view

The API response returns MIME type: text/javascript and so does code-manager as information. Also: "mime_category": "text"