Skip to content
This repository has been archived by the owner on Dec 3, 2020. It is now read-only.

Promise resolution after context is destroyed #60

Closed
Osmose opened this issue Aug 20, 2018 · 0 comments
Closed

Promise resolution after context is destroyed #60

Osmose opened this issue Aug 20, 2018 · 0 comments
Milestone

Comments

@Osmose
Copy link
Contributor

Osmose commented Aug 20, 2018

This is mostly a rambling reminder to look into this later.

Once #39 lands, we'll be getting a bunch of errors in the browser console along the lines of "Promise resolved after context was destroyed". This seems to imply that we have some promises resolving after the toolbar panels are closed, but I'm not entirely sure how to handle this error. I don't yet have solid reproduction steps, but finding some shouldn't be too hard after the PR lands.

@Osmose Osmose added this to the November MVP milestone Aug 20, 2018
biancadanforth added a commit that referenced this issue Sep 8, 2018
This patch makes it possible for the user to undelete a deleted product to their list of tracked products while the browserAction popup remains open. If the browserAction popup closes, any deleted products will be removed permanently.

Implementation notes:
* Add the DELETE_PRODUCT action which dispatches when the user clicks the ‘X’ button for a product.
  * The product card is greyed out, cannot be clicked to open the product page, and an Undo button appears in the top right corner.
* Add the UNDELETE_PRODUCT action which dispatches when the user clicks the ‘Undo’ button for a product.
  * The product card is restored to its original view and behavior.
* Replace the REMOVE_PRODUCT action with the DELETE_MARKED_PRODUCTS action which dispatches when the browserAction is closed.
  * Any greyed out cards will be gone the next time the popup is opened.

In Nightly, when the DELETE_MARKED_PRODUCTS action is dispatched, the error from Issue #60 is logged, though it does not affect the functionality of this patch.

Follow-up issues:
* #93: Show a loading screen for the first render before the app's state has been loaded.
Osmose pushed a commit that referenced this issue Oct 19, 2018
Switch to using a messaging port disconnect to detect when the browser action
closes. Without this, dismissing price alerts is not consistent as the JS
context for the browser action is unloaded before the async work of updating
the store is finished.

Because we are no longer performing async work after the browser action unloads,
we no longer see the errors from #60 about promises resolving after the context
is destroyed.
@Osmose Osmose closed this as completed in f5f70e4 Oct 20, 2018
Osmose added a commit that referenced this issue Oct 20, 2018
Fix #112, fix #60: Dismiss price alerts when browser action closes.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants