Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Windows Build Doc & Package.json for Windows #54

Closed
wants to merge 5,229 commits into from
Closed

Conversation

mayurdw
Copy link

@mayurdw mayurdw commented Aug 13, 2017

The current JSON file cause errors because of the file separators. I added new commands inside the file specially for Windows. Every windows command is with a prefix 'windows-'
The build installation.md file also reflects that and follow the steps I took to build
PR for Issue #18

jstejada and others added 30 commits March 20, 2017 16:16
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
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
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
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
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
On the server the env var is defined but set to false.
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
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
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
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
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
Summary: See title

Test Plan: manual

Reviewers: gleb, mark

Reviewed By: mark

Differential Revision: https://phab.nylas.com/D4256
…rter

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
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
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
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
Summary:
These only really matter for n1cloud, and are being added manually in
production, so no migration file necessary. I am adding them to the
model definitions to prevent them getting out of sync with production
for development.

See T7999 for full SQL review

Test Plan: ship it

Reviewers: evan, khamidou, juan

Reviewed By: juan

Subscribers: vlad, jerm

Differential Revision: https://phab.nylas.com/D4230
Summary: Should help a fair bit with our redis connection pileup.

Test Plan: Tested manually.

Reviewers: mark, spang, juan, evan

Reviewed By: mark, spang, evan

Differential Revision: https://phab.nylas.com/D3916
mikeseese and others added 10 commits July 9, 2017 22:59
Fixes #38
Previously when editing or adding to a message that you were forwarding, upon sending the message all edits would be lost. This appears to fix the issue.

* Change forceWrite param to use this.draft.
Removed -b alias for --benchmark option which collides with --background option.
Resolve -b option collision
Adjust first download section according to the second
Moves the unsubscribe plugin into an internal package.
* init: `unsubscribe` as internal package

Integrate n1-unsubscribe into nylas-mail directly
See: https://github.com/colinking/n1-unsubscribe

* fix broken N1 api request

and fix out-of-date “N1” references with “Nylas Mail”
The current JSON file cause errors because of the file separators. I added new commands inside the file specially for Windows. Every windows command is with a prefix 'windows-'
The build installation.md file also reflects that and follow the steps I took to build
Copy link
Member

@dweremeichik dweremeichik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like that we have to do this, however I understand. Quick question, if you use git bash or cygwin, do you need this fix?

package.json Outdated
@@ -42,18 +42,26 @@
"underscore": "1.8.x"
},
"scripts": {
"windows-start":"npm run client-windows",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is client-windows correct here? Shouldn't it be windows-client?

npm run windows-build-client
```
7. If there are no errors in the previous two steps, start the app with:
```bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation.

@mayurdw
Copy link
Author

mayurdw commented Aug 13, 2017

@dweremeichik I made the fixes and pushed them. Regarding your question

Quick question, if you use git bash or cygwin, do you need this fix?

I don't know honestly. I used Command Prompt for my build. I don't know what @seesemichaelj used.

@mikeseese
Copy link
Contributor

@dweremeichik I'm going to give this all a try and will get back tomorrow with my review

@mikeseese
Copy link
Contributor

Dependencies are not stylized in a list:
image

@mikeseese
Copy link
Contributor

Replicating your instructions cannot execute npm install properly. the Isomorphic library doesn't build

@mayurdw
Copy link
Author

mayurdw commented Aug 22, 2017

What is the error you get? @seesemichaelj

@mikeseese
Copy link
Contributor

It could not find the Windows SDK 8.1. I guess I didn't check that when installing the community version.

@mayurdw
Copy link
Author

mayurdw commented Aug 22, 2017

You mean the VS community installation?

@mikeseese
Copy link
Contributor

Yes; I believe the Windows 8.1 SDK was not installed by default when installing VS Community. It was under "Windows 8.1 and ... Tools" or something like that

@mikeseese
Copy link
Contributor

Yup that definitely was the error; all of the isomorphic core stuff is building now

@mikeseese
Copy link
Contributor

we could get away from multiple build commands by using node scripts like https://shapeshed.com/writing-cross-platform-node/#scripts-in-package-json

@mikeseese
Copy link
Contributor

mikeseese commented Aug 22, 2017

Now I'm getting the error C:\nylas-mail\packages\client-app\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c(34): error C2373: '_ _pfnDliNotifyHook2': redefinition; different type modifiers [C:\nylas-mail\packages\client-app\node_modules\sqlite3\bui ld\deps\sqlite3.vcxproj]

Doing nodejs/node-gyp#972 (comment) (npm -g install npm@next) fixed my issue. I guess I was using an old npm version (3), and now I'm using 5?

That seems to get me to work for npm install. I'm not sure how much of this should be documented. Maybe a "troubleshooting" section?

@@ -35,3 +35,33 @@ If you are looking to simply install Nylas-Mail on your system (and are not look
npm start
```
* If an error was thrown during the build process, please make sure all of your dependencies were installed in step 2.

## Windows:
1. Install Node.js version 6.9.x ( Can use Windows [NVM](https://github.com/coreybutler/nvm-windows))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove space before "Can"

## Windows:
1. Install Node.js version 6.9.x ( Can use Windows [NVM](https://github.com/coreybutler/nvm-windows))
2. Dependencies:
A. Visual Studio 2015 Community
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A/B/C/D are not styled properly, see image

2. Dependencies:
A. Visual Studio 2015 Community
B. Python 2.7 (v3.x.x is not supported)
C. create a environment variable PYTHON pointing at :\\path\\python.exe
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think environment variables can be a separate step and not dependencies.

I would also specify how you can create an environment variable. One option is doing this in the command prompt with set VARIABLENAME=VARIABLEVALUE

@mikeseese
Copy link
Contributor

This PR is no longer applicable due to the conflicts of the new merge. Please rebase to the new master branch and bring over your fixes. You can cherry-pick the commits. Please see the v2.1.0 branch to see the old master branch. Thanks!

There are also some discrepancies previously mentioned that need to be addressed.

@mikeseese mikeseese closed this Sep 23, 2017
@mikeseese mikeseese deleted the windows.doc branch September 24, 2017 20:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.