diff --git a/examples/N1-Composer-Templates/icon.png b/examples/N1-Composer-Templates/icon.png index b01405fd2..25ff1e71f 100644 Binary files a/examples/N1-Composer-Templates/icon.png and b/examples/N1-Composer-Templates/icon.png differ diff --git a/examples/N1-Composer-Translate/icon.png b/examples/N1-Composer-Translate/icon.png index b5c9c061a..3c7cc296c 100644 Binary files a/examples/N1-Composer-Translate/icon.png and b/examples/N1-Composer-Translate/icon.png differ diff --git a/internal_packages/worker-sync/lib/nylas-sync-worker.coffee b/internal_packages/worker-sync/lib/nylas-sync-worker.coffee index 1d34440a5..bb6391504 100644 --- a/internal_packages/worker-sync/lib/nylas-sync-worker.coffee +++ b/internal_packages/worker-sync/lib/nylas-sync-worker.coffee @@ -94,9 +94,9 @@ class NylasSyncWorker @fetchCollection('threads') if @_account.usesLabels() - @fetchCollection('labels') + @fetchCollection('labels', {initialPageSize: 1000}) if @_account.usesFolders() - @fetchCollection('folders') + @fetchCollection('folders', {initialPageSize: 1000}) @fetchCollection('drafts') @fetchCollection('contacts') @fetchCollection('calendars') @@ -116,7 +116,10 @@ class NylasSyncWorker @writeState() @fetchCollectionCount(model) - @fetchCollectionPage(model, {offset: 0, limit: INITIAL_PAGE_SIZE}) + @fetchCollectionPage(model, { + limit: options.initialPageSize ? INITIAL_PAGE_SIZE, + offset: 0 + }) fetchCollectionCount: (model) -> @_api.makeRequest diff --git a/internal_packages/worker-sync/spec/nylas-sync-worker-spec.coffee b/internal_packages/worker-sync/spec/nylas-sync-worker-spec.coffee index 464f71cc6..42660310c 100644 --- a/internal_packages/worker-sync/spec/nylas-sync-worker-spec.coffee +++ b/internal_packages/worker-sync/spec/nylas-sync-worker-spec.coffee @@ -62,6 +62,10 @@ describe "NylasSyncWorker", -> expect(modelsRequested).toEqual(['threads', 'labels', 'drafts', 'contacts', 'events']) expect(countsRequested).toEqual(['/threads', '/labels', '/drafts', '/contacts', '/events']) + fit "should fetch 1000 labels and folders, to prevent issues where Inbox is not in the first page", -> + labelsRequest = _.find @apiRequests, (r) -> r.model is 'labels' + expect(labelsRequest.params.limit).toBe(1000) + it "should mark incomplete collections as `busy`", -> @worker.start() advanceClock() @@ -102,7 +106,6 @@ describe "NylasSyncWorker", -> advanceClock(30000); expect(@worker.resumeFetches.callCount).toBe(5) it "handles the request as a failure if we try and grab labels or folders without an 'inbox'", -> - spyOn(@worker, 'resumeFetches').andCallThrough() @worker.start() expect(@worker.resumeFetches.callCount).toBe(1) @@ -113,7 +116,6 @@ describe "NylasSyncWorker", -> expect(@worker.resumeFetches.callCount).toBe(2) it "handles the request as a success if we try and grab labels or folders and it includes the 'inbox'", -> - spyOn(@worker, 'resumeFetches').andCallThrough() @worker.start() expect(@worker.resumeFetches.callCount).toBe(1) diff --git a/spec/nylas-api-spec.coffee b/spec/nylas-api-spec.coffee index 8a5f76c52..1e218060a 100644 --- a/spec/nylas-api-spec.coffee +++ b/spec/nylas-api-spec.coffee @@ -55,7 +55,6 @@ describe "NylasAPI", -> expect(Actions.postNotification.mostRecentCall.args[0].message).toEqual("Nylas can no longer authenticate with your mail provider. You will not be able to send or receive mail. Please unlink your account and sign in again.") describe "handleModelResponse", -> - beforeEach -> spyOn(DatabaseStore, "persistModels").andCallFake (models) -> Promise.resolve(models)