The default bug view has changed. See this FAQ.

Remove Promise.defer usage

RESOLVED FIXED in 4.0.0.1

Status

Calendar
Internal Components
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: Fallen, Assigned: discoman)

Tracking

Trunk
4.0.0.1

Details

(Whiteboard: [good first bug][lang=js])

Attachments

(2 attachments, 2 obsolete attachments)

(Reporter)

Description

2 years ago
I totally liked Promise.defer, but this is not a feature of DOM promises, which will supersede Promise.jsm at some point and will be removed in bug 1034599. We need to replace them with DOM promises in calendar code or use PromiseUtils from bug 1093021.
(Assignee)

Comment 1

2 years ago
Created attachment 8556857 [details] [diff] [review]
bug-1095119.diff

https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Promise.jsm/Deferred

Here, I realized that implementation of new Promise() as deferred object would require a helper function first and so it's better to look out for places where new Promise can be implemented easily and I found it was in only test_deleted_items.js, every where else our beloved deferred object is used to resolve promise in different parts of code,so I implemented new Promise() here. Would request a review and help in case I have done something wrong.
Attachment #8556857 - Flags: review?(philipp)
(Reporter)

Comment 2

2 years ago
Comment on attachment 8556857 [details] [diff] [review]
bug-1095119.diff

Review of attachment 8556857 [details] [diff] [review]:
-----------------------------------------------------------------

You are right, we surprisingly don't use promises that much. Code looks great, thanks for the patch! Let me know if you need more issues to work on. r=philipp.

For checkin, could you change the patch message from "Remove Promise.defer" to something like "Bug 1095119 - Remove Promise.defer usage. r=philipp", upload that as a new attachment and set the checkin-needed keyword? You can directly set review+ on the new patch since I've already +'d this one.
Attachment #8556857 - Flags: review?(philipp) → review+
(Reporter)

Updated

2 years ago
Assignee: nobody → sparshpaliwal123
Status: NEW → ASSIGNED
(Assignee)

Comment 3

2 years ago
Created attachment 8557016 [details] [diff] [review]
bug-1095119.diff

Thank you very much for the help,I never submitted a patch so quickly. If something is wrong with this one we will get back to it. Meanwhile which of these you think i should do next-
Bug-366680
Bug-396515
Bug-842383
Bug-472630
Attachment #8557016 - Flags: review+
Attachment #8557016 - Flags: checkin?
(Reporter)

Updated

2 years ago
Attachment #8557016 - Flags: checkin?
(Reporter)

Updated

2 years ago
Keywords: checkin-needed
(Reporter)

Updated

2 years ago
Attachment #8556857 - Attachment is obsolete: true
(Reporter)

Comment 4

2 years ago
I think bug 472630 would be nice, if you want another simple one then bug 842383 is also a good candidate.
(Reporter)

Updated

2 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 4.0

Comment 5

2 years ago
Created attachment 8557388 [details] [diff] [review]
fix test failure

The patch caused a failure in the test it is touching:
TEST-UNEXPECTED-FAIL | xpcshell-icaljs.ini:calendar/test/unit/test_deleted_items.js | xpcshell return code: 0
SyntaxError: expected expression, got ')' at /builds/slave/test/build/tests/xpcshell/tests/calendar/test/unit/test_deleted_items.js:31
ReferenceError: run_test is not defined at /builds/slave/test/build/tests/xpcshell/head.js:504

I try to fix the syntax error in this patch.

Aryx, please push to try server.
Flags: needinfo?(archaeopteryx)

Updated

2 years ago
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Pushed to Thunderbird-Try https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=805e9cd652fa
Flags: needinfo?(archaeopteryx)

Comment 7

2 years ago
Created attachment 8557426 [details] [diff] [review]
fix test failure v2

Didn't work :)
Attachment #8557388 - Attachment is obsolete: true
Attachment #8557426 - Flags: review?(philipp)

Comment 8

2 years ago
Comment on attachment 8557016 [details] [diff] [review]
bug-1095119.diff

http://hg.mozilla.org/comm-central/rev/613cf9f167f3
(Reporter)

Updated

2 years ago
Status: REOPENED → RESOLVED
Last Resolved: 2 years ago2 years ago
Resolution: --- → FIXED
(Reporter)

Comment 9

2 years ago
Pushed to comm-central changeset 12201ec2a310
(Reporter)

Comment 10

2 years ago
Sorry about the missing push comment, my python script had an error. I'll update the other bugs in case they haven't already been.
(Reporter)

Comment 11

2 years ago
Comment on attachment 8557426 [details] [diff] [review]
fix test failure v2

Oops I totally missed you already uploaded a patch, sorry about that. The patch I pushed does about the same thing and also fixes the order of setting the handleCompletion function and calling aFunc().
Attachment #8557426 - Flags: review?(philipp)
You need to log in before you can comment on or make changes to this bug.