Bug 1795797 - Await CalDAVServer.putItemInternal wherever it is called. r=mkmelin

I missed one of these in a review comment. It turns out there are many calls which do not await, although it doesn't appear to make any difference.

Differential Revision: https://phabricator.services.mozilla.com/D159823

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Geoff Lankow 2022-10-24 22:35:42 +00:00
Родитель 58284fce8d
Коммит 61a9cafb6f
4 изменённых файлов: 37 добавлений и 33 удалений

Просмотреть файл

@ -44,13 +44,13 @@ add_task(async function testAlarms() {
add_task(async function testSyncChanges() { add_task(async function testSyncChanges() {
await syncChangesTest.setUp(); await syncChangesTest.setUp();
CalDAVServer.putItemInternal( await CalDAVServer.putItemInternal(
"ad0850e5-8020-4599-86a4-86c90af4e2cd.ics", "ad0850e5-8020-4599-86a4-86c90af4e2cd.ics",
syncChangesTest.part1Item syncChangesTest.part1Item
); );
await syncChangesTest.runPart1(); await syncChangesTest.runPart1();
CalDAVServer.putItemInternal( await CalDAVServer.putItemInternal(
"ad0850e5-8020-4599-86a4-86c90af4e2cd.ics", "ad0850e5-8020-4599-86a4-86c90af4e2cd.ics",
syncChangesTest.part2Item syncChangesTest.part2Item
); );

Просмотреть файл

@ -41,13 +41,13 @@ add_task(async function testAlarms() {
add_task(async function testSyncChanges() { add_task(async function testSyncChanges() {
await syncChangesTest.setUp(); await syncChangesTest.setUp();
CalDAVServer.putItemInternal( await CalDAVServer.putItemInternal(
"ad0850e5-8020-4599-86a4-86c90af4e2cd.ics", "ad0850e5-8020-4599-86a4-86c90af4e2cd.ics",
syncChangesTest.part1Item syncChangesTest.part1Item
); );
await syncChangesTest.runPart1(); await syncChangesTest.runPart1();
CalDAVServer.putItemInternal( await CalDAVServer.putItemInternal(
"ad0850e5-8020-4599-86a4-86c90af4e2cd.ics", "ad0850e5-8020-4599-86a4-86c90af4e2cd.ics",
syncChangesTest.part2Item syncChangesTest.part2Item
); );

Просмотреть файл

@ -4,20 +4,22 @@
var { CalDAVServer } = ChromeUtils.import("resource://testing-common/calendar/CalDAVServer.jsm"); var { CalDAVServer } = ChromeUtils.import("resource://testing-common/calendar/CalDAVServer.jsm");
CalDAVServer.open(); add_setup(async function() {
CalDAVServer.putItemInternal( CalDAVServer.open();
"5a9fa76c-93f3-4ad8-9f00-9e52aedd2821.ics", await CalDAVServer.putItemInternal(
CalendarTestUtils.dedent` "5a9fa76c-93f3-4ad8-9f00-9e52aedd2821.ics",
BEGIN:VCALENDAR CalendarTestUtils.dedent`
BEGIN:VEVENT BEGIN:VCALENDAR
UID:5a9fa76c-93f3-4ad8-9f00-9e52aedd2821 BEGIN:VEVENT
SUMMARY:exists before time UID:5a9fa76c-93f3-4ad8-9f00-9e52aedd2821
DTSTART:20210401T120000Z SUMMARY:exists before time
DTEND:20210401T130000Z DTSTART:20210401T120000Z
END:VEVENT DTEND:20210401T130000Z
END:VCALENDAR END:VEVENT
` END:VCALENDAR
); `
);
});
registerCleanupFunction(() => CalDAVServer.close()); registerCleanupFunction(() => CalDAVServer.close());
add_task(async function() { add_task(async function() {
@ -154,7 +156,7 @@ add_task(async function testSyncError2() {
// Add some items to the server so multiple requests are required to get // Add some items to the server so multiple requests are required to get
// them all. There's already one item on the server. // them all. There's already one item on the server.
for (let i = 0; i < 3; i++) { for (let i = 0; i < 3; i++) {
CalDAVServer.putItemInternal( await CalDAVServer.putItemInternal(
`fake-uid-${i}.ics`, `fake-uid-${i}.ics`,
CalendarTestUtils.dedent` CalendarTestUtils.dedent`
BEGIN:VCALENDAR BEGIN:VCALENDAR

Просмотреть файл

@ -4,20 +4,22 @@
var { CalDAVServer } = ChromeUtils.import("resource://testing-common/calendar/CalDAVServer.jsm"); var { CalDAVServer } = ChromeUtils.import("resource://testing-common/calendar/CalDAVServer.jsm");
CalDAVServer.open(); add_setup(async function() {
CalDAVServer.putItemInternal( CalDAVServer.open();
"5a9fa76c-93f3-4ad8-9f00-9e52aedd2821.ics", await CalDAVServer.putItemInternal(
CalendarTestUtils.dedent` "5a9fa76c-93f3-4ad8-9f00-9e52aedd2821.ics",
BEGIN:VCALENDAR CalendarTestUtils.dedent`
BEGIN:VEVENT BEGIN:VCALENDAR
UID:5a9fa76c-93f3-4ad8-9f00-9e52aedd2821 BEGIN:VEVENT
SUMMARY:exists before time UID:5a9fa76c-93f3-4ad8-9f00-9e52aedd2821
DTSTART:20210401T120000Z SUMMARY:exists before time
DTEND:20210401T130000Z DTSTART:20210401T120000Z
END:VEVENT DTEND:20210401T130000Z
END:VCALENDAR END:VEVENT
` END:VCALENDAR
); `
);
});
registerCleanupFunction(() => CalDAVServer.close()); registerCleanupFunction(() => CalDAVServer.close());
add_task(async function() { add_task(async function() {