Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upWait for feature flag data before loading sidebar view #2684
Conversation
robertknight
added
the
groups-launch
label
Oct 29, 2015
nickstenning
reviewed
Oct 29, 2015
| @@ -21,58 +21,66 @@ | ||
| */ | ||
| 'use strict'; | ||
| var retry = require('retry'); |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
robertknight
added some commits
Oct 27, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
|
LGTM. |
added a commit
that referenced
this pull request
Oct 29, 2015
nickstenning
merged commit f502519
into
master
Oct 29, 2015
nickstenning
deleted the
gh2675-wait_for_features
branch
Oct 29, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
|
This also fixes #2530. |
nickstenning
referenced this pull request
Oct 29, 2015
Closed
Flush feature flags on login/logout #2530
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
robertknight commentedOct 27, 2015
This fixes an issue where the app could show a private group as focused in the top bar but annotations from the public group.
This happened when:
In this scenario, when the initial search queries the focused group, it will get Public because until the feature flag data is returned, private groups is disabled.
Once the feature flag data loads, the groups feature is enabled, the focused group implicitly changes to the user's last selected private group but the annotation search is not updated.
The approach taken here is to request features at the same time as session data on sidebar load and wait for both before loading the view and requesting annotations.
features.fetch()now returns a promise which resolves when the features are fetched or the retrieval fails. I left out the exponential retry logic for the moment. If fetching feature data fails, the client will simply behave as if all features are turned off until the cache expires. I'm happy to reconsider this if we think it is important enough to keep.SESSION_CHANGEDonce #2674 is merged