Commit graph

183 commits

Author SHA1 Message Date
Evan Morikawa 83cab70d68 [client-app] add better documentation to windows update 2017-03-27 18:19:50 -07:00
Evan Morikawa ddee8b83f7 [client-app] directly call windows relaunch on squirrel update 2017-03-27 18:06:11 -07:00
Evan Morikawa fc5645b9eb [client-app] remap windows dev shortcuts 2017-03-27 17:13:42 -07:00
Halla Moore 4ad4596e2f [client-app, client-sync] Add specs for detecting stuck sync/worker window
Summary: See title. Part of T7681.

Test Plan: ran the specs

Reviewers: evan, mark, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4264
2017-03-27 15:45:33 -07:00
Halla Moore 73f0f3eeda [client-app] Detect when the worker window is unavailable
Summary:
Periodically ping client-sync's /health endpoint and store the latest
sync activity. If we get an ECONNREFUSED error, the worker window is
unavailable. Report the last known activity and restart the worker
window. Part of T7681.

Test Plan: manual, specs

Reviewers: evan, mark, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D4263
2017-03-27 15:42:18 -07:00
Halla Moore 7355527397 [client-app] Retry queries when database is locked
Summary:
We still don't know exactly what scenarios cause us to get 'database is
locked' errors, but generically this means that we have multiple
processes trying to access the database at the same time. In an attempt
to handle this gracefully, this diff makes it so that we retry the
queries in these cases. Theoretically, the database should free up once
the other process is done using it, and the erroring process just needs
to wait its turn. We still throw an error after 5 retries, so if there's
a larger issue, we'll still be able to tell in Sentry.

Addresses T7992

Test Plan:
I opened a transaction in the worker window and then tried to
do the same in the main window. If I didn't release the transaction in
the worker window, the main window eventually errored. If I did release
the transaction, the main window continued creating its own transaction.

Reviewers: mark, juan, evan

Reviewed By: juan, evan

Differential Revision: https://phab.nylas.com/D4254
2017-03-27 15:22:28 -07:00
Juan Tejada 9216ef1ca7 [client-app] Update changelog 2017-03-27 08:37:34 -07:00
Nylas Coffee Machine 8a3e47df4e bump(version): 1.0.48 2017-03-27 00:04:26 -07:00
Mark Hahnenberg 11aa686809 [client-app] Reindex threads when they're updated
Summary:
We weren't doing that, so we would have accurate search index info for
threads when they were, e.g., moved to another folder.

Test Plan: Run locally

Reviewers: spang, evan, juan

Reviewed By: evan, juan

Differential Revision: https://phab.nylas.com/D4260
2017-03-24 15:14:58 -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 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
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
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 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
Nylas Coffee Machine d5b8e1993e bump(version): 1.0.44 2017-03-20 08:37:27 -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
Nylas Coffee Machine 27355c91eb bump(version): 1.0.43 2017-03-17 07:38:47 -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
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
Nylas Coffee Machine c8e31a7812 bump(version): 1.0.40 2017-03-15 06:34:12 -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
Juan Tejada 7fc1e043c1 [client-app] Restart sync when computer awakes from sleep
Summary:
Use electron's `powerMonitor` module to detect when the computer resumes
from sleep, and restart the sync loop when that happens in order to
sync the inbox immediately, in case we received any new mail events
while the computer was asleep

Test Plan: manual

Reviewers: evan, spang, halla

Reviewed By: halla

Differential Revision: https://phab.nylas.com/D4216
2017-03-13 22:44:09 -07:00
Juan Tejada f157ddb867 [client-app] Make resetEmailCache work without forcing re sign-in
Summary:
This commit makes it so `resetEmailCache` works as expected, i.e. it
removes all databases, without forcing the user to re sign-in to their
accounts or NylasID

Previously, this method removed the database without removing the
accounts, left users in an un-authed state that was hard to recover
from. This was fixed in D4212 which makes sure that when we get a new
identity, sync and deltas are restarted

However, resetEmailCache would still force you to log in to yoru NylasID
because it was deleted from the database. However, if we reuse the
command `application:relaunch-to-initial-windows` instead of manually
deleting the database, we can relaunc the app while preserving the users
NylasID session, so they don't have to sign back in manually.

Test Plan: manual

Reviewers: evan, spang, halla

Reviewed By: halla

Differential Revision: https://phab.nylas.com/D4215
2017-03-13 22:42:52 -07:00
Juan Tejada 4d1628b914 [client-app] Don't start sync or delta connections without an identity
Summary:
This prevents the app from entering a restart loop when there's no
identity.

Specifically, when a user logs out of their identity, or when she resets the
email cache, or any other scenario that leaves the app without an
identity but with accounts added, the sync loop (and deltas) will start
without an Identity.

This will cause NylasAPIRequest to throw an error that
forces the user to close the app. When the app restarts, sync will start
again without an identity, and the user will be forced to close the app
again, and so on and so forth for the rest of eternity

Relevant error:
https://github.com/nylas/nylas-mail-all/blob/master/packages/client-app/src/flux/nylas-api-request.es6#L165-L174

Additionaly, this makes sure that after resetting the email cache, the sync
process starts when the identity becomes available

This solves T7989

Test Plan: manual

Reviewers: evan, spang, halla

Reviewed By: halla

Differential Revision: https://phab.nylas.com/D4212
2017-03-13 20:00:59 -07:00
Juan Tejada a6684db5c4 [client-app] Update changelog 2017-03-13 19:51:02 -07:00
Evan Morikawa 1f2370c2a9 [client-app] run windows build separately
Summary:
build-client, aka packaging, aka bundling is now separate from uploading.
This is both to compartmentalize our tasks a bit more and so we can add a
non-grunt windows task inbetween packaging and uploading.

No more heavily-overloaded PUBLISH_BUILD flag.
Added SIGN_BUILD flag instead.
No more TRAVIS and TRAVIS_PULL_REQUEST flag.

Test Plan: Manual

Reviewers: halla, juan, spang

Reviewed By: juan, spang

Differential Revision: https://phab.nylas.com/D4208
2017-03-13 15:48:45 -07:00
Evan Morikawa e883122ccf [client-app] remove ability to run specs
Summary:
This removes specs from the build production version.

One of the major issues with the windows build was that one of the package
specs included a .node compiled file that the codesigner attempte to sign,
but couldn't find for some reason.

In testing, removing the specs from the build prod version fixed this.

While we could just remove the one offending test, I think we should just
remove the whole suite from the build version. That'd save in the number
of files we have to ship, save download time, save build time, and have
less chance for some symlinked issue failling a build in the future.

Test Plan: Manual

Reviewers: khamidou, halla, juan, spang

Reviewed By: juan, spang

Differential Revision: https://phab.nylas.com/D4206
2017-03-13 15:47:58 -07:00