Commit graph

5667 commits

Author SHA1 Message Date
Juan Tejada 41ad424752 [client-app] Don't try to restart sync on every IdentityStore change
Summary:
The IdentityStore can trigger any number of times, but we only want to
start sync if we previously didn't have an identity available

Test Plan: manual

Reviewers: spang, evan, halla

Reviewed By: evan, halla

Differential Revision: https://phab.nylas.com/D4246
2017-03-24 13:06:47 -07:00
Juan Tejada 43738771ac [client-app] Correctly remove inline images with x button
Summary:
Before this commit, it was impossible to remove inline images via the x
button

Test Plan: manual

Reviewers: mark, halla

Reviewed By: mark, halla

Differential Revision: https://phab.nylas.com/D4257
2017-03-24 13:03:28 -07:00
Juan Tejada cd6d04c4a6 [ei] Update changelog 2017-03-24 10:21:03 -07:00
Nylas Coffee Machine c5af73f358 bump(version): 1.0.47 2017-03-23 22:55:20 -07:00
Karim Hamidou a8aee89ae0 [client-app] Report hard crashes using Electron's built-in crash reporter
Summary:
I had a bit of downtime this morning so I decided to look into how to store Electron crash data. Electron, like Chromium, stores crash data in an arcane file format named minidump.

There's a bunch of services you can use to store files formatted in this format, like Mozilla's Socorro or zcbenz's own mini-breakpad-server but they're all pretty hard to install. Luckily, it turns out there's a Ruby gem to process minidump files and send them to Sentry! Seeing that, I whipped up a quick sinatra service and hosted it on Heroku – you can take a look at the source code here if you're curious: https://github.com/khamidou/electron-breakpad-sentry

This diff adds the client-side code we need to start sending crash reports.

Test Plan: Tested manually.

Reviewers: juan, evan

Reviewed By: juan, evan

Maniphest Tasks: T7926

Differential Revision: https://phab.nylas.com/D4259
2017-03-23 15:18:27 -07:00
Juan Tejada 09b88a759c [client-app] Consolidate file download metric reporting
Summary: See title

Test Plan: manual

Reviewers: gleb, mark

Reviewed By: mark

Differential Revision: https://phab.nylas.com/D4256
2017-03-23 13:26:28 -07:00
Juan Tejada 1298d4c529 [client-app] Update changelog 2017-03-23 12:23:34 -07:00
Mark Hahnenberg 4ef8e7614e [client-sync] Don't handle IMAP timeouts in the connection pool
Summary:
Different clients can have different policies for retrying after
timeouts.

Test Plan: Run locally, run tests

Reviewers: evan, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4247
2017-03-23 11:33:53 -07:00
Mark Hahnenberg e13d4832ff [client-app] Record file download times
Summary:
We'd like to get an idea of how long the client app is having to wait
when requesting a file. Waiting can cause things like inline image
attachments to appear very slow to load.

Test Plan: Run locally

Reviewers: evan, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4255
2017-03-23 11:32:19 -07:00
Nylas Coffee Machine ce17f70f26 bump(version): 1.0.46 2017-03-22 22:28:54 -07:00
Halla Moore 9caefdc687 [client-app] Rename downloadDataForFile(s) -> getDownloadDataForFile(s)
Summary:
The original name seems like it's initiating the download, when really
it's just returning the data of an already in-progress/completed
download.

Test Plan: Manual, specs

Reviewers: evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4251
2017-03-22 17:17:08 -07:00
Halla Moore 470e6563ec [client-app] Ensure files get transferred in forwarded messages
Summary:
We need to download the files and then treat them as uploads. Rather
than using an actual Upload object, which would require another data
transfer, we create an object with all the necessary Upload-like
properties and point it to the downloaded file.

Addresses part of T7960

Test Plan: Manual, some specs

Reviewers: evan, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4249
2017-03-22 12:05:35 -07:00
Karim Hamidou 3e3b0b84f1 Switch type of Metadata value column
Summary:
Found a funny send-later bug I didn't catch when testing on staging: sometimes the data we're saving in the metadata table overflows. That's because MySQL's TEXT column are at most 64k, which is easy to reach when you have a draft + clearbit information and additional stuff.

To work around this, I decided to switch the database type of the metadata table to LONGTEXT. Since it can store 4Gb of text, we should be good. This diff makes those code changes. Obviously, we'll have to run migrations both on staging and prod.

Test Plan: Ran a basic smoke test. Shouldn't break anything.

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D4250
2017-03-22 12:03:11 -07:00
Karim Hamidou 1f9c5120cd Fix build condition
On the server the env var is defined but set to false.
2017-03-22 11:06:59 -07:00
Halla Moore b849793a72 [client-app] Fix DraftFactory specs
Summary: Using `await` instead of `advanceClock()` fixes all the things!

Test Plan: Ran the spec file

Reviewers: evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4248
2017-03-21 15:46:48 -07:00
Mark Hahnenberg 2fe8bee38f [client-sync] Refactor sync worker IMAPConnectionPool callbacks
Summary: In preparation for removing timeout handling from the IMAPConnectionPool.

Test Plan: Run locally

Reviewers: spang, evan, juan

Reviewed By: evan, juan

Differential Revision: https://phab.nylas.com/D4245
2017-03-21 12:15:40 -07:00
Juan Tejada 65f9f8cdbe [client-app] 🎨 comment 2017-03-21 11:45:30 -07:00
Juan Tejada 8f5d36746d [client-app] Correctly sign out of NylasID
Summary:
This fixes T7995.

Previously, attempting to log out from your NylasID would just
automatically sign you back in with the same NylasID because the webview
session was preserved.

Now, instead of relaunching the windows, we restart the app to clear the
webview session

Test Plan: manual

Reviewers: halla, evan

Reviewed By: evan

Maniphest Tasks: T7995

Differential Revision: https://phab.nylas.com/D4224
2017-03-21 11:44:48 -07:00
Juan Tejada 6ea9ab3fbf [client-app] Don't report non-reportable errors in delta connection
Summary:
Previously, the logic for deciding wether to report an APIError lived
inside NylasAPIRequest and depended on an array of ignorable
statusCodes. However, when handling APIErrors, NylasAPIRequest would
convert special error codes (for offline errors) into a statusCode of 0,
which would automatically be ignored.

Given that the delta streaming connection didn't convert status codes to
0, it wouldn't actually ignore the error and end up reporting it,
flooding sentry.

This commit makes it so that that logic lives inside APIError, and
anyone who handles APIErrors can check wether to report them or not,
including the delta streaming connection

Test Plan: manual :(

Reviewers: spang, evan, halla

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D4235
2017-03-21 11:43:41 -07:00
Juan Tejada 6048d6a80c [client-app] Update changelog 2017-03-21 10:39:40 -07:00
Nylas Coffee Machine 3b3057fd2d bump(version): 1.0.45 2017-03-21 09:30:12 -07:00
Juan Tejada d025aaf369 [dev] Actually fix tmp dir path in daily 2017-03-21 09:29:46 -07:00
Juan Tejada 17da34caed [dev] Fix temp dir path in daily 2017-03-21 09:25:46 -07:00
Juan Tejada 3554fb2510 [client-app] Fix passing cursor to delta streams
Summary:
Currently, when we auth an account for the first time in Nylas Mail (or
we blow away the database), the app is going to request transactions
since cursor `null` from the /delta/streaming endpoint and from the local-sync
delta observable, instead of requesting transactions since cursor `0`

This is due to a subtle bug with the use of default values when
destructuring an object. Our coded did the following:
```
const {cursor = 0} = this._state
```
Which at a glance seems correct. However, this will only work as
expected if `this._state` has the following shape:
```
{cursor: undefined}
```
And unfortunately, our `this._state` looked like this when authing an
account for the first time:
```
{cursor: null}
```

Which would make `cursor === null` instead of `0`.
This is because when using default values, null is considered an
intentional argument/value, as opposed to not passing any argument/value
(which will mean that the argument is undefined).

This was a regression introduced in d60a23c and 8bc2ec5

Test Plan: manual, will add regression test in upcoming diff

Reviewers: evan, spang, halla

Reviewed By: halla

Differential Revision: https://phab.nylas.com/D4243
2017-03-20 16:16:46 -07:00
Juan Tejada 3909c8885a [cloud-api] Fix query for delta stream transactions
Summary:
When querying transactions for the delta stream, if no cursor is provided,
we should default to 0. Otherwise this will generate a query like:
```
WHERE `transaction`.`id` > ‘null’
```
Which is obviously wrong

Test Plan: manual

Reviewers: evan, halla, spang

Reviewed By: spang

Differential Revision: https://phab.nylas.com/D4242
2017-03-20 15:39:24 -07:00
Nylas Coffee Machine d5b8e1993e bump(version): 1.0.44 2017-03-20 08:37:27 -07:00
Jeremy Price 180f92b78a [deploy-it] temp override for deploy branch rules
for ei-prod only.  I set up the ei EB env as prod level, but
have been working on launch changed in master branch. Easy enough to undo,
but I didn't wan't to mess with prod branch until done because
the launch scripts affect all the n1cloud-related environments.
2017-03-18 15:26:08 -07:00
Juan Tejada 6532d3c647 [client-sync] Add error handling when creating syncback requests
Summary: see title. also convert to es6

Test Plan: manual

Reviewers: evan, halla

Reviewed By: halla

Differential Revision: https://phab.nylas.com/D4225
2017-03-17 13:59:37 -07:00
Juan Tejada eb64ae67d2 [client-app] Update changelog 2017-03-17 10:59:40 -07:00
Juan Tejada 64e6fefbd4 [client-app] Update changelog 2017-03-17 10:49:46 -07:00
Juan Tejada f1572f4bfc [dev] Fix path for tmp dir in daily script 2017-03-17 10:08:00 -07:00
Nylas Coffee Machine 27355c91eb bump(version): 1.0.43 2017-03-17 07:38:47 -07:00
Christine Spang e87bea789d Revert "[iso-core] Upgrade nodemailer"
This reverts commit e798e50d1a.

Reason for revert: breaks Send Later. Needs more testing.
2017-03-16 15:09:09 -07:00
Halla Moore 73e990fc05 [client-app] Don't show non-existent children on folder creation
Summary:
Previously, after creating a new folder, the UI would indicate that the new
folder had children, even though it didn't. This was caused by duplicate models
in our `MutableQueryResultSet` for the user's categories. Basically, we would
sync the server version of the folder before the `SyncbackTask` for the new
folder returned its `serverId`. Without the `serverId`, the synced version of
the folder couldn't yet be tied to the optimistic folder, so a second row was
created in the database. This second row is removed when the `syncbackTask`
does return the `serverId`, because we persist the optimistic folder with a
`REPLACE INTO` query. (This deletes other rows with the same id.) However,
since this was done inside a `persist` change with the `serverId` and no
`unpersist` was ever recorded for the `clientId`, our `MutableQueryResultSet`
never removed the `clientId` model.

To address this, this diff adds a check in `updateModel` to see if the
`serverId` is being added. If it is, and both the `serverId` and `clientId`
exist in the `_ids` list, we remove the `clientId`.

The children indicator does still briefly show up while there are still two
separate rows for that folder in the database. If we want to get rid of this
completely, we would have to ensure that we do not sync the folder before the
`syncbackTask` returns the `serverId`. However, this would probably be pretty
involved, and for not much gain. This fix is much simpler and reduces most of
the issue.

Test Plan: manual

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D4228
2017-03-16 12:26:42 -07:00
Halla Moore 4492b73507 [client-sync] Only update lastReceivedDate if the message was actually received
Summary:
We don't want to bump threads to the top of the inbox when a user sends a
reply. We originally used `!isSent` to prevent this, but that was removed in
a diff that made sure messages showed up in the inbox when users send emails
to themselves. In order to implement both of these cases properly, this diff
introduces `isReceived` and uses that to determine whether lastReceivedDate
should be updated. Addresses T7991.

Also changes the order of some `or` statements, so that we actually check that
the variable exists before comparing against it.

Test Plan: manual

Reviewers: evan, juan, spang

Reviewed By: spang

Differential Revision: https://phab.nylas.com/D4226
2017-03-16 12:25:56 -07:00
Nylas Coffee Machine 67f9d26d66 bump(version): 1.0.42 2017-03-16 12:14:19 -07:00
Evan Morikawa f4b01b3c13 [client-app] don't exclude source maps 2017-03-16 12:07:05 -07:00
Nylas Coffee Machine 4079fd4b98 bump(version): 1.0.41 2017-03-16 10:05:48 -07:00
Christine Spang e798e50d1a [iso-core] Upgrade nodemailer
Summary:
We were using a version that was ~9 months old and a lot of development has
happened since.

v3 is not compatible w/v2, but it looks like we aren't using any of the
features that had breaking changes:

    http://nodemailer.com/about/migrate/

I chose not to switch to the new built-in OAuth2 token refresh support
because we already have a mechanism for refreshing oauth tokens and
adding a different implementation specifically for SMTP would introduce
more opportunities for bugs.

Since mailcomposer is no longer a dependency of nodemailer, I added this
dependency as well.

Test Plan: manual - sent a message, sent a message w/an attachment

Reviewers: evan, khamidou, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4201
2017-03-15 16:24:32 -07:00
Nylas Coffee Machine c8e31a7812 bump(version): 1.0.40 2017-03-15 06:34:12 -07:00
Evan Morikawa 093f315f59 [client-app] don't bootsrap cloud stuff when building the client
Summary:
We don't need to spend the time running script/bootstrap in our cloud-*
folders!

Test Plan: manual

Reviewers: spang, juan, halla

Reviewed By: juan, halla

Differential Revision: https://phab.nylas.com/D4214
2017-03-14 13:39:56 -07:00
Evan Morikawa b3681e6567 [client-app] update files ignored in build
Summary:
The ignore list was very old. It included several dozen MB of docs_src and
other crap in our builds

Test Plan: manual

Reviewers: halla, spang, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4213
2017-03-14 13:39:40 -07:00
Evan Morikawa 613ee2b568 [client-app] upload nupkg for Windows autoupdater
Summary: We need to upload the nupkg for the Windows autoupdater to work

Test Plan: manual

Reviewers: juan, spang, halla

Reviewed By: halla

Differential Revision: https://phab.nylas.com/D4219
2017-03-14 13:35:09 -07:00
Karim Hamidou 3a92eaf857 [send-later] Add support for attachments
Summary:
This is going to be a diff way shorter than the previous one! Basically, it adds a new endpoint, `/blobs` to our API to store send later attachments. When a user schedules a draft to be sent, we send all attachments to this endpoint. Separately, we store the rest of the message as metadata.

When it's time to send the message, we fetch the attachments from S3, fetch the metadata and merge them together to get a message we can send.

Test Plan: Tested manually. Will make a final QA pass before landing.

Reviewers: juan, halla, evan

Reviewed By: halla, evan

Differential Revision: https://phab.nylas.com/D4196
2017-03-14 12:24:04 -07:00
Evan Morikawa 5b33cc1274 [client-app] "two panel" -> "Reading Pane On"
Summary: Minor copy change via Sachin

Test Plan: manual

Reviewers: juan, spang, halla

Reviewed By: halla

Differential Revision: https://phab.nylas.com/D4218
2017-03-14 10:55:25 -07:00
Nylas Coffee Machine 27927e1f5c bump(version): 1.0.39 2017-03-14 10:44:15 -07:00
Juan Tejada 87acb233b7 [client-app] Fix missing depedency for imap-provider-settings 2017-03-14 10:42:30 -07:00
Evan Morikawa af7d8c98c6 [client-app] only upload 7 characters of the commit hash
Summary:
On windows running `git rev-parse --short HEAD` does in fact now give you
9 characters instead of 7 like it does on Mac. This will ensure that
builds get uploaded to the same folder and help ensure we don't post a
version that doesn't exist on the release page.

Test Plan: Manual

Reviewers: juan, halla, spang

Reviewed By: spang

Differential Revision: https://phab.nylas.com/D4217
2017-03-14 10:37:24 -07:00
Juan Tejada 30792a47bf [client-app] Update changelog 2017-03-14 09:19:10 -07:00
Nylas Coffee Machine 3c88f9000a bump(version): 1.0.38 2017-03-13 22:58:30 -07:00