Closed Bug 1672433 Opened 4 years ago Closed 4 years ago

Remove backward compatibility method getDescription from devtools/client/fronts/device.js

Categories

(DevTools :: Shared Components, task, P3)

task

Tracking

(firefox84 fixed)

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: jdescottes, Assigned: vaga)

References

Details

(Keywords: good-first-bug)

Attachments

(1 file)

The following method was only needed when connecting to FF69 or older, which are no longer supported.

  /**
   * Handle backward compatibility for getDescription.
   * Can be removed on Firefox 70 reaches the release channel.
   */
  async getDescription() {
    const description = await super.getDescription();

    // Backward compatibility when connecting for Firefox 69 or older.
    if (typeof description.canDebugServiceWorkers === "undefined") {
      description.canDebugServiceWorkers = !description.isMultiE10s;
    }

    return description;
  }

https://searchfox.org/mozilla-central/rev/25d5a4443a7e13cfa58eff38f1faa5e69f0b170f/devtools/client/fronts/device.js#23-36

The method can be removed. Bug 1664767 will update the same file, better wait for the other bug to land to avoid conflicts. Setting as good first bug.

I can continue to clean this file. Can you assign me?

Flags: needinfo?(jdescottes)

Sure Fabien! Thanks for helping with this cleanup (and sorry about the delay).
Assigning this to you.

Assignee: nobody → fabien
Status: NEW → ASSIGNED
Flags: needinfo?(jdescottes)

Do I have to remove entries in spec file?
https://searchfox.org/mozilla-central/source/devtools/shared/specs/device.js#11-15

Finally, DeviceFront and deviceSpec seem to be empty and useless. What do I have to do?

Flags: needinfo?(jdescottes)

My bad, deviceSpec is used by DeviceActor (https://searchfox.org/mozilla-central/source/devtools/server/actors/device.js#25)

So, only DeviceFront seems to be empty and useless and doesn't implement spec methods of deviceSpec.

Correct, and even if this front currently doesn't provide any added value, it is still required by the framework.
Let's keep it for now :)

Flags: needinfo?(jdescottes)
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9163c138b0ee
Remove backward compatibility method getDescription from devtools/client/fronts/device.js r=jdescottes

Backed out changeset 9163c138b0ee (bug 1672433) for test_front_destroy failures.

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&selectedTaskRun=IZ903woAStCRDMzynh_g3A.1&searchStr=linux%2C18.04%2Cx64%2Cwebrender%2Copt%2Cxpcshell%2Ctests%2Ctest-linux1804-64-qr%2Fopt-xpcshell-e10s%2Cx1&fromchange=a41982f2e7ff59dcf930b472ad4a72a6217efa6b&tochange=a769f9f08c63619a7747b97cf0e7a874cdd09f0e

Backout link: https://hg.mozilla.org/integration/autoland/rev/a769f9f08c63619a7747b97cf0e7a874cdd09f0e

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=319766601&repo=autoland&lineNumber=3434

[task 2020-10-26T16:38:16.420Z] 16:38:16     INFO -  TEST-START | devtools/server/tests/xpcshell/test_front_destroy.js
[task 2020-10-26T16:38:16.585Z] 16:38:16  WARNING -  TEST-UNEXPECTED-FAIL | devtools/server/tests/xpcshell/test_front_destroy.js | xpcshell return code: 0
[task 2020-10-26T16:38:16.585Z] 16:38:16     INFO -  TEST-INFO took 163ms
[task 2020-10-26T16:38:16.585Z] 16:38:16     INFO -  >>>>>>>
[task 2020-10-26T16:38:16.585Z] 16:38:16     INFO -  (xpcshell/head.js) | test MAIN run_test pending (1)
[task 2020-10-26T16:38:16.585Z] 16:38:16     INFO -  (xpcshell/head.js) | test run_next_test 0 pending (2)
[task 2020-10-26T16:38:16.586Z] 16:38:16     INFO -  (xpcshell/head.js) | test MAIN run_test finished (2)
[task 2020-10-26T16:38:16.587Z] 16:38:16     INFO -  running event loop
[task 2020-10-26T16:38:16.587Z] 16:38:16     INFO -  devtools/server/tests/xpcshell/test_front_destroy.js | Starting test
[task 2020-10-26T16:38:16.588Z] 16:38:16     INFO -  (xpcshell/head.js) | test test pending (2)
[task 2020-10-26T16:38:16.588Z] 16:38:16     INFO -  "Create and connect the DevToolsClient"
[task 2020-10-26T16:38:16.588Z] 16:38:16     INFO -  (xpcshell/head.js) | test run_next_test 0 finished (2)
[task 2020-10-26T16:38:16.589Z] 16:38:16     INFO -  "Get the device front and check calling getDescription() on it"
[task 2020-10-26T16:38:16.590Z] 16:38:16     INFO -  TEST-PASS | devtools/server/tests/xpcshell/test_front_destroy.js | test - [test : 28] Check that the getDescription() method returns a valid response. - true == true
[task 2020-10-26T16:38:16.591Z] 16:38:16     INFO -  "Destroy the device front and try calling getDescription again"
[task 2020-10-26T16:38:16.591Z] 16:38:16     INFO -  Unexpected exception Error: Can not send request 'getDescription' because front 'device' is already destroyed. at resource://devtools/shared/protocol/Front/FrontClassWithSpec.js:28
[task 2020-10-26T16:38:16.591Z] 16:38:16     INFO -  generateRequestMethods/</frontProto[name]@resource://devtools/shared/protocol/Front/FrontClassWithSpec.js:28:15
[task 2020-10-26T16:38:16.591Z] 16:38:16     INFO -  test@/builds/worker/workspace/build/tests/xpcshell/tests/devtools/server/tests/xpcshell/test_front_destroy.js:36:11
[task 2020-10-26T16:38:16.591Z] 16:38:16     INFO -  _do_main@/builds/worker/workspace/build/tests/xpcshell/head.js:248:6
[task 2020-10-26T16:38:16.592Z] 16:38:16     INFO -  _execute_test@/builds/worker/workspace/build/tests/xpcshell/head.js:577:5
[task 2020-10-26T16:38:16.593Z] 16:38:16     INFO -  @-e:1:1
[task 2020-10-26T16:38:16.593Z] 16:38:16     INFO -  exiting test
[task 2020-10-26T16:38:16.594Z] 16:38:16     INFO -  <<<<<<<
[task 2020-10-26T16:38:16.596Z] 16:38:16     INFO -  INFO | Result summary:
[task 2020-10-26T16:38:16.596Z] 16:38:16     INFO -  INFO | Passed: 624
[task 2020-10-26T16:38:16.596Z] 16:38:16  WARNING -  INFO | Failed: 1
[task 2020-10-26T16:38:16.596Z] 16:38:16  WARNING -  One or more unittests failed.
[task 2020-10-26T16:38:16.596Z] 16:38:16     INFO -  INFO | Todo: 0
[task 2020-10-26T16:38:16.596Z] 16:38:16     INFO -  INFO | Retried: 1
[task 2020-10-26T16:38:16.596Z] 16:38:16     INFO -  SUITE-END | took 600s
[task 2020-10-26T16:38:16.596Z] 16:38:16     INFO -  Node moz-http2 server shutting down ...
[task 2020-10-26T16:38:16.599Z] 16:38:16     INFO -  http3Server server shutting down ...
[task 2020-10-26T16:38:16.750Z] 16:38:16    ERROR - Return code: 1
[task 2020-10-26T16:38:16.750Z] 16:38:16     INFO - TinderboxPrint: xpcshell-xpcshell<br/>624/<em class="testfail">1</em>/0
[task 2020-10-26T16:38:16.751Z] 16:38:16  WARNING - # TBPL FAILURE #
[task 2020-10-26T16:38:16.751Z] 16:38:16  WARNING - setting return code to 2
[task 2020-10-26T16:38:16.752Z] 16:38:16  WARNING - The xpcshell suite: xpcshell ran with return status: FAILURE
Flags: needinfo?(fabien)

Before, getDescription of DeviceFront returned always a promise (async function). (https://searchfox.org/mozilla-central/rev/25d5a4443a7e13cfa58eff38f1faa5e69f0b170f/devtools/client/fronts/device.js#27)

Now, it use getDescription of FrontClassWithSpec and throw the error before to return the promise. (https://searchfox.org/mozilla-central/source/devtools/shared/protocol/Front/FrontClassWithSpec.js#28)

I sent a new patch.

I don't know if I have to comment here or in moz-phab.

Flags: needinfo?(fabien) → needinfo?(jdescottes)

(In reply to Fabien Casters from comment #9)

I don't know if I have to comment here or in moz-phab.

There is no strict process. Commenting on bugzilla is what we do most of the time. Your comment is helpful and will make it easier to understand why the patch was backed out in case anyone stumbles on this in the future.

Flags: needinfo?(jdescottes)
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/15ff11c9bad8
Remove backward compatibility method getDescription from devtools/client/fronts/device.js r=jdescottes
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: