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

Fix crash in unsubscribeFromQuery #260

Merged
merged 1 commit into from
Oct 11, 2016
Merged

Commits on Oct 11, 2016

  1. Fix bugs around unsubscribe and skipping

    See #255.
    
    @glasser and I found a few bugs around the (old and new) skip options,
    and wrote some tests to confirm the fixes and stop regressions
    
    - didn't delete querySubscription in .unsubscribeFromQuery()
      - this mean if you skipped and then unskipped, it would break
    
    - not checking for querySubscription before .unsubscribe on unmounting
      - if you skip then unmount, you have problem
    
    - check for non-skip -> skip in willReceiveProps didn't return in the remain skipping case
      - mean "non skipping" code ran when remaining skipping.
    
    - Make the default data have an "errors" null field rather than "error"
      since that matches what is done elsewhere.
    
    - Also make sure to consistently set it to null rather than undefined.
    
    - Be a little more consistent about how we initialize and re-initialize
      this.data; for example, if we use the deprecated skip option to change
      an unskipped query to a skipped query, include "error: null" as well,
      and if we are switching from unskip to skip to unskip, make sure to
      re-initialize the full data object.
    glasser committed Oct 11, 2016
    Configuration menu
    Copy the full SHA
    8ee1a1f View commit details
    Browse the repository at this point in the history