Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.0.0 Beta 6 #358

Merged
merged 14 commits into from
Feb 23, 2019
Merged

Release 1.0.0 Beta 6 #358

merged 14 commits into from
Feb 23, 2019

Conversation

pr1sm
Copy link
Collaborator

@pr1sm pr1sm commented Feb 23, 2019

Changes

Checks

  • CI passes
  • Coverage (<2%∆)
  • Manual Checks
    • test in dev
    • test in prod
    • test in pack

pr1sm and others added 13 commits February 11, 2019 23:54
* Refactor DsmParser

This commit refactors DsmParser to offer extensibility when parsing for
site/product specific hash properties. By default no parsing is done, but
subclasses of DsmParser can now provide an implementation to have this
parsing done if necessary on the initial page, product pages, or both

Additionally, the file is moved to a new folder where all dsm parser
variants can live.

* Implement DsmUsParser

This commit implements a specific DsmParser variant for the US Site. This
includes parsing a product page for a specific hash property that is
within a binary encoded string in a script attached to the product page.

* Implement DsmUkParser

This commit implements a specific DsmParser variant for the UK Site. This
includes parsing for a custom.js sourced script in both the initial page
and product pages head element. The script is then fetched and its contents
are parsed to find the included hash property. If the hash property is
found on the initial page, the parsing for the hash property on the product
page is skipped -- this prevents an unnecessary additional request.

* Update Special Parser Selections

This commit updates the getSpecialParser method to include the
refactored DsmParser as well as the new variants for specific sites.

The specialParser is also updated slightly to allow for asynchronous
implementations when parsing the initial/product pages. This allows the
DsmUkParser to function properly since it has to fetch the custom.js
file for parsing the hash property.

* Fix Task Runner Lints

This commit fixes some small lints to remove all lint errors/warnings
in the task runner package.

* Fix Typo in Logs

Co-Authored-By: pr1sm <dhanwada.dev@gmail.com>

* Finish Writing Doc Comment

This commit finishes an incomplete doc comment.
* updated navbar resposiveness

* updated navbar responsiveness

* remove source maps, progress on navbar

* navbar done

* fixed tests

* added active flag back for icons
* setup old and new settings page for refactoring

* proxy list and webhooks done

* settings page refactor done, cleanup needed

* small css change

* Update packages/frontend/src/state/actions/navbar/navbarActions.js

* Update packages/frontend/src/state/actions/navbar/navbarActions.js

* Update packages/frontend/src/state/actions/navbar/navbarActions.js

* Update packages/frontend/src/state/actions/navbar/navbarActions.js

* Update packages/frontend/src/app.jsx

* Update packages/frontend/src/app.jsx

* Update packages/frontend/src/navbar/navbar.jsx

* Update packages/frontend/src/navbar/navbar.jsx

* Update packages/frontend/src/navbar/navbar.jsx

* rm navbar icon

* fixed tests to reflect proper classnames

* fixed lint
* started profiles sass refactor

* couple comments

* updated tasks scss that was outdated, and update sass compile command

* fixed unit tests

* starting work on profiles scss rewrite

* removed map files, updated profiles layout

* updated to profiles sass rewrite

* profiles page semi-done, needs cleaning up

* Update packages/frontend/src/app.jsx

* Update packages/frontend/src/app.jsx

* Update packages/frontend/src/navbar/navbar.jsx

* Update packages/frontend/src/navbar/navbar.jsx

* Update packages/frontend/src/navbar/navbar.jsx

* Update packages/frontend/src/state/actions/navbar/navbarActions.js

* Update packages/frontend/src/state/actions/navbar/navbarActions.js

* Update packages/frontend/src/state/actions/navbar/navbarActions.js

* Update packages/frontend/src/state/actions/navbar/navbarActions.js

* cleanup

* remove unnecessary css

* Added back in shipping/billing id to location fields

* made bms visible, needs aligning

* fix swap proxy infinite loop

* fix swap proxy infinite loop

* started profiles sass refactor

* couple comments

* updated tasks scss that was outdated, and update sass compile command

* fixed unit tests

* starting work on profiles scss rewrite

* removed map files, updated profiles layout

* updated to profiles sass rewrite

* profiles page semi-done, needs cleaning up

* Update packages/frontend/src/app.jsx

* Update packages/frontend/src/app.jsx

* Update packages/frontend/src/navbar/navbar.jsx

* Update packages/frontend/src/navbar/navbar.jsx

* Update packages/frontend/src/navbar/navbar.jsx

* Update packages/frontend/src/state/actions/navbar/navbarActions.js

* Update packages/frontend/src/state/actions/navbar/navbarActions.js

* Update packages/frontend/src/state/actions/navbar/navbarActions.js

* Update packages/frontend/src/state/actions/navbar/navbarActions.js

* cleanup

* remove unnecessary css

* Added back in shipping/billing id to location fields

* made bms visible, needs aligning

* some test fixes

* added bms back in

* fixed tests, need to move bms tests to location still

* lint fix...

* small styling changes

* compiled css changed

* added test ids for later PR, also removed redundant code
* start app themes

* more progress toward app theming

* app themes progress

* theme progress

* theme propagate throughout the app

* rm some comments that caused weird prettier errors

* react select stying done

* fixed unit testing on react-select

* fixed icons visual bugs

* PR changes

* rm scrollbar css, causes problems on windows
…342)

* Remove Task Manager Wrapper

This commit removes the task manager wrapper file to accommodate the incoming TaskWrapper class. The new task will be responsible for all the same items as the TaskManagerWrapper, so the old class is no longer needed.

* Add TaskWrapper and TaskLauncher Window

This commit adds a new TaskWrapper class that launches a new hidden BrowserWindow that runs a TaskManagerWrapper class. Instead one file handling all responsibilities, these two classes handle managing task related functions.

The old TaskManagerWrapper is split between these two classes to effectively offload work done on the main process to a secondary process. This should hopefully improve responsiveness, but it mainly enables the future use of webworker threads for task runners.

This commit represents most of the work complete, but there are still a couple of lingering implementations to finish:
- Captcha Windows error out with invalid site key
- Cleanup for running task processes when quitting the app

* Rename Files and Misc Cleanup

This commit updates the naming of the refactored classes to better describe their function.

This commit also performs some small cleanup to other files.

* Add Task Cleanup

This commit adds the cleanup functionality for tasks when the main window closes. This prevents hanging tasks from continuing to run after the app quits.

* fix typo in comments

Co-Authored-By: pr1sm <dhanwada.dev@gmail.com>

* Pass correct sitekey

This commit fixes a bug that prevented the captcha sitekey from being set properly. a missing argument in the handler shifted parameters over, so the sitekey got set improperly.

* Use Proxy on CaptchaWindow instead of Protocol

This commit updates the method of proxying the captcha window to use a proxy instead of using electron's protocol api. This reduces the area of effect of the captcha server to just the captcha windows instead of having an effect on all requests.

Finally this commit removes a script tag to a file that doesn't exist in the captcha html.

* Rename IPC Channel

This commit changes an IPC channel name to be more descriptive.
* added theme opts to captcha window

* fix unit test failure

* added ipc to propagate already opened windows

* updated underlying issue with my efforts

* pr changes

* fixed typo

* final pr changes
* Implement TaskThreadManager

This commit implements a task manager variant that uses worker threads. A new worker is spawned for each new task that appears. All functionality should work, but hasn't been fully tested at this time.

The TaskThreadManager is added to the export list for use in the
frontend.

* Fix Typos in TaskProcessManager

THis commit fixes some various spelling typos found in the process manager files when implementing the task thread manager.

* Use Task Thread Manager

This commit updates the frontend to support using the task thread manager. The dev environment is adjusted to use it, but more testing should occur before it is used as the default.

Further, a check was added to make sure worker threads are supported before using the TaskThreadManager. If the are not supported a warning message is printed and the TaskProcessManager is used instead.

* Address PR Comments

This commit addresses changes requested in PR:
- TaskManager now has an Abort event defined. this is used instead of a string literal
- TaskThreadManager now properly handles aborting on close
- TaskThreadManager has changes to remove eslint errors
- TaskThreadManager now checks for Webworker compatibliity in constructor. An error is thrown if there is no compatibility
- TaskThreadManager and TaskProcessManager are refactored slightly to reduce code duplication
- TaskManagerAdapter has better logic for falling back when worker threads are unavailable

* Restructure Manager Files

This commit restructures manager files into their own folders. This helps visually group similar classes/files.

* Consolidate Shared Transformer Code

This commit consolidates shared code between the two scripts that ran on child contexts (either process or thread). Most the the code has been extracted out to a base class and sub classes have been created for each implementation.

* Refactor Managers to Consolidate Code

This commit refactors similar code from the TaskProcessManager and TaskThreadManager into a new SplitContextTaskManager. This class is used as a base class for all future task managers that run in split contexts. Subclasses for processes and worker threads have been implemented and are now used by the frontend.

* Fix SendProxy Bug

This commit fixes a bug that prevented tasks from starting due to a typo in the send proxy side effect handler.

* Fix Launcher Object Destroyed Bug

This commit fixes a bug due to improper handling of the launcher ipc tunnel. When the tunnel closes, the launcher now does not attempt to send any messages, which prevents a crash like this from occurring.

* Adjust TaskEvent Registration Logic

This commit adjusts the logic surrounding registering for task events.
Now the launcher will register for events as soon as the adapter is
ready. This prevents any possibility of the task event chain not being
set up properly to forward events to the frontend.

This commit also hides console logs so they only show in dev mode and
renames the manager.html file to a more appropriate launcher.html

* Start Launcher when Transitioning to the Auth State

This commit fixes a bug where deactivating the frontend would prevent the task launcher from starting again. A code path to launch the main window was missing the call to start the launcher as well.

* Add Linter Exemptions for Certain Classes

We have a requirement to use instance methods within the Transformer subclasses, but the implementations don't use `this`. Since this is a valid exception to the rule, an eslint comment is added to the top of both to convey this.

See https://eslint.org/docs/rules/class-methods-use-this#exceptions for more details

* Adjust Event Emitter Max Listeners

This commit adjusts the max listeners for the TaskManager and TaskRunner event listeners. This allows many tasks (>25) to run without producing memory leak warnings.

* Fix Delay and Webhook Event Passing

This commit updates the event handlers to allow responding to a bulk event. In this case the ID passed will be 'ALL'. This allows a single event to be emitted when adjusting a delay or webhook in the TaskManager for all tasks.

This also keeps the contract of purely using event based communication between the manager and runner.

* Refactor Default TaskManager Implementation

This commit updates the default single thread TaskManager Implementation to have similar syntax as the SplitContextTaskManager. This ensures all TaskManger implementations work when used.

* Switch Defaults to use SplitThreadTaskManger

This commit updates the default task manager to use the multi thread implementation. The set env var for prod is also updated to use thread instead of process.

fixes #192
* fixed sitemap invalid parameter issue

* added monitor + checkout timers

* added timer checks when monitoring / running for restocks

* split out getCheckout into super and subclasses

* reverse getCheckout split and added variant monitoring for frontend

* fixed unable to match variants bug

* pr changes addressed

* removed defn causing lint failure

* added handle parsing
* Start Refactoring CaptchaWindowManager

This commit starts the refactor for the new CaptchaWindowManager. This manager will be in charge of all captcha windows instead of having a manager instance per window.

At this time, the old captcha window manager is still in use. Once the new manage is written. the regular WindowManager will have to be adjusted to use the new CaptchaWindowManager

* Add Injectable Options for Youtube and Captcha Windows

This commit updates the create window functions for Youtube and Captcha to allow custom options and webPreferences to be injected in. This allows further customizations when creating these windows.

* More Implementation Progress

This commit adds more progress towards implementing a new CaptchaWindowManager.
- Specific functions to spawn youtube and captcha windows are added
- The end session handler is implemented.
- Adjustments to the Youtube Launch handler

* Transition to Use New Captcha Window Manager

This commit replaces the old implementation of WindowManager to use the new CaptchaWindowManager for captcha/youtube functions.

The old captcha window manager implementation is removed. There is still some code in the WindowManager that needs to be moved over to the CaptchaWindowManager. For now, these calls are just proxied so they work.

* Cleanup WindowManager

This commit adds some cleanup for the window manager.

The change theme handler has been commented out until #350 is addressed.

* Use Harvest State when Spawning New Captcha Window

This commit updates the Captcha Window Manager to automatically start harvesting on a new window if the rest of the windows are in the harvesting state. This allows you to open/close all captcha windows, but have new window harvest if a captcha is still required.

Issue: #106

* Increase Speed of Captcha Stopping

Instead of reloading the page, the captcha window now only loads the captcha methods once and resets when it stops harvesting. The captcha form is hidden to display the idle animation again. This prevents a reload cycle from happening everytime the captcha finishes harvesting

Issue: #272

* Remove Proxy on captcha window load

This commit removes the captcha server proxy when the window loads. This allows the youtube window experience to function properly.

* Fix Captcha Windows not closing on deactivate

This commit adds a call to always close the captcha windows when the main window closes. This should include both when closing and deactivating.

* Fix Captcha Window Auto Spawn

This commit fixes a bug where a captcha window would not be spawned if it was needed.

fixes #97
fixes #106
fixes #272
fixes #317
* proxy map rewrite

* added site to task management

* added site param in handle swap

* small pr changes

* more progress

* added removing and placing proxy near the end

* added some changes

* latest changes

* latest

* latest
@pr1sm pr1sm added the type:release Release Level PRs label Feb 23, 2019
@pr1sm pr1sm added this to the Beta 6 Release milestone Feb 23, 2019
@pr1sm
Copy link
Collaborator Author

pr1sm commented Feb 23, 2019

+1 for dev and prod -- when pack finishes, I think we can merge

@pr1sm
Copy link
Collaborator Author

pr1sm commented Feb 23, 2019

merging...

@pr1sm pr1sm merged commit 144b5ca into master Feb 23, 2019
@pr1sm pr1sm deleted the b1.0.0-beta.6 branch February 23, 2019 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:release Release Level PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants