Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

feat: timers in plugins #1452

Merged
merged 6 commits into from Sep 22, 2019
Merged

feat: timers in plugins #1452

merged 6 commits into from Sep 22, 2019

Conversation

alessiodf
Copy link
Contributor

Resolves #1446 by implementing a TIMERS permission that exposes clearInterval, clearTimeout, setInterval and setTimeout.

It uses internal arrays to store the IDs of any timeouts and intervals to make sure they are all cleared once the route navigation changes and it also works with nested timers. A watchdog object is used to keep track of pending timeouts so they are immediately removed from the array once executed in order to prevent excessive memory usage that could potentially arise by repeatedly executing timeouts. The IDs are also removed from their respective arrays when clearInterval or clearTimeout are called. It also includes appropriate tests.

The reason for adding the feature was outlined in #1446.

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Refactor
  • Performance
  • Tests
  • Build
  • Documentation
  • Code style update
  • Continuous Integration
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes
  • No

Does this PR release a new version?

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

  • It's submitted to the develop branch, not the master branch
  • All tests are passing
  • New/updated tests are included

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

@ghost
Copy link

ghost commented Sep 12, 2019

Thanks for submitting this pull request! A maintainer will review this in the next few days and explicitly select labels so you know what's going on.

If no reviewer appears after a week, a reminder will be sent out.

@ghost ghost added Complexity: Medium Less than 256 lines changed. Type: Feature The issue is a request for new functionality. labels Sep 12, 2019
@codecov-io
Copy link

codecov-io commented Sep 12, 2019

Codecov Report

Merging #1452 into develop will increase coverage by 0.54%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1452      +/-   ##
===========================================
+ Coverage    40.86%   41.41%   +0.54%     
===========================================
  Files          237      237              
  Lines         6585     6616      +31     
  Branches      1298     1306       +8     
===========================================
+ Hits          2691     2740      +49     
+ Misses        3651     3645       -6     
+ Partials       243      231      -12
Impacted Files Coverage Δ
src/renderer/services/plugin-manager.js 14.44% <100%> (+12.31%) ⬆️
src/renderer/components/Network/NetworkModal.vue 40.93% <0%> (ø) ⬆️
...derer/services/plugin-manager/wallet-components.js 66.66% <0%> (+66.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 92298cf...7658ad2. Read the comment docs.

@ghost ghost added the Status: Needs Changes The pull request needs additional changes before it can be merged. label Sep 21, 2019
src/renderer/services/plugin-manager.js Outdated Show resolved Hide resolved
src/renderer/services/plugin-manager.js Outdated Show resolved Hide resolved
@ghost
Copy link

ghost commented Sep 21, 2019

Your pull request needs some changes. Please wait for a comment from one of our developers for more information.

src/renderer/services/plugin-manager.js Outdated Show resolved Hide resolved
src/renderer/services/plugin-manager.js Outdated Show resolved Hide resolved
@alexbarnsley alexbarnsley added the Bounty: Tier 4 Awarded for small features, refactorings, improvements. This is valued at 20 USD. label Sep 22, 2019
@ghost ghost added the Status: Member Approved The pull request has been approved by a member. label Sep 22, 2019
@ghost
Copy link

ghost commented Sep 22, 2019

A member has approved this PR. A maintainer will merge this PR shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait.

Thank you for your contribution!

@alexbarnsley alexbarnsley merged commit c60b941 into ArkEcosystem:develop Sep 22, 2019
@ghost
Copy link

ghost commented Sep 22, 2019

Your pull request has been merged and marked as tier 4. It will earn you $20 USD.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bounty: Tier 4 Awarded for small features, refactorings, improvements. This is valued at 20 USD. Complexity: Medium Less than 256 lines changed. Status: Member Approved The pull request has been approved by a member. Status: Needs Changes The pull request needs additional changes before it can be merged. Type: Feature The issue is a request for new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

plugins: setTimeout and setInterval
3 participants