generated from MetaMask/template-snap-monorepo
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Fixes and Performance Improvements #489
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
ae5570e
feat: open WS connections onActive
xavier-brochard 5cc3e6f
docs: jsdoc
xavier-brochard 53bed83
chore: platform version
xavier-brochard c411d86
fix: never remove native asset
xavier-brochard bacff60
feat: move refreshSend to background event
xavier-brochard 3e40c58
test: add unit test
xavier-brochard 77ef1e0
feat: only run refresh cronjobs when the matching UI is open
xavier-brochard 26870c4
chore: shasum
xavier-brochard 8135396
chore: improve logging
xavier-brochard c6a93c6
chore: clean up
xavier-brochard b4c89ba
fix: review remarks
xavier-brochard f973013
docs: jsdoc
xavier-brochard e719e08
test: fix unit test
xavier-brochard 3ab27bc
fix: scheduling flow
xavier-brochard e892ffa
fix: review
xavier-brochard 2954294
chore: clean up
xavier-brochard 43e9e99
chore: clean up
xavier-brochard f60b3b0
feat: parallelize requests
xavier-brochard a2c83ae
chore: shasum
xavier-brochard 144a083
chore: clean up
xavier-brochard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev
Previous commit
chore: clean up
- Loading branch information
commit 144a0838e6bf7660d521992d951980de5b674f93
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,14 +12,11 @@ import { | |
| updateInterface, | ||
| } from '../../../utils/interface'; | ||
| import baseLogger, { createPrefixedLogger } from '../../../utils/logger'; | ||
| import { ScheduleBackgroundEventMethod } from './ScheduleBackgroundEventMethod'; | ||
|
|
||
| export const refreshSend: OnCronjobHandler = async () => { | ||
| const logger = createPrefixedLogger(baseLogger, '[refreshSend]'); | ||
|
|
||
| logger.info( | ||
| `[${ScheduleBackgroundEventMethod.RefreshSend}] Background event triggered`, | ||
| ); | ||
| logger.info(`Background event triggered`); | ||
|
|
||
| const [assets, mapInterfaceNameToId, preferences] = await Promise.all([ | ||
| assetsService.getAll(), | ||
|
|
@@ -35,9 +32,7 @@ export const refreshSend: OnCronjobHandler = async () => { | |
|
|
||
| // Don't do anything if the send form interface is not open | ||
| if (!sendFormInterfaceId) { | ||
| logger.info( | ||
| `[${ScheduleBackgroundEventMethod.RefreshSend}] ❌ No send form interface found`, | ||
| ); | ||
| logger.info(`No send form interface found`); | ||
| return; | ||
| } | ||
|
|
||
|
|
@@ -62,16 +57,12 @@ export const refreshSend: OnCronjobHandler = async () => { | |
|
|
||
| // We only want to refresh the token prices when the user is in the transaction confirmation stage | ||
| if (interfaceContext.stage !== 'transaction-confirmation') { | ||
| logger.info( | ||
| `[${ScheduleBackgroundEventMethod.RefreshSend}] ❌ Not in transaction confirmation stage`, | ||
| ); | ||
| logger.info(`❌ Not in transaction confirmation stage`); | ||
| return; | ||
| } | ||
|
|
||
| if (!interfaceContext.assets) { | ||
| logger.info( | ||
| `[${ScheduleBackgroundEventMethod.RefreshSend}] ❌ No assets found`, | ||
| ); | ||
| logger.info(`❌ No assets found`); | ||
| return; | ||
| } | ||
|
|
||
|
|
@@ -90,7 +81,5 @@ export const refreshSend: OnCronjobHandler = async () => { | |
| updatedInterfaceContext, | ||
| ); | ||
|
|
||
| logger.info( | ||
| `[${ScheduleBackgroundEventMethod.RefreshSend}] ✅ Background event suceeded`, | ||
| ); | ||
| logger.info(`✅ Background event suceeded`); | ||
| }; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BugThe
As a result:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.