Skip to content

Commit

Permalink
delete feature flag enable_query_renderer_set_state_prevention
Browse files Browse the repository at this point in the history
Reviewed By: alunyov

Differential Revision: D50332420

fbshipit-source-id: 9052fb2f83f036d2439c584ecd550c5bf3075d7c
  • Loading branch information
sammy-SC authored and facebook-github-bot committed Oct 17, 2023
1 parent 3d66ad8 commit 5c069d7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 31 deletions.
31 changes: 2 additions & 29 deletions packages/react-relay/ReactRelayQueryRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,35 +171,8 @@ class ReactRelayQueryRenderer extends React.Component<Props, State> {
const newState = resetQueryStateForUpdate(this.props, prevState);
const {requestCacheKey, queryFetcher} = newState;
if (requestCacheKey != null && requestCache[requestCacheKey] != null) {
if (RelayFeatureFlags.ENABLE_QUERY_RENDERER_SET_STATE_PREVENTION) {
// $FlowFixMe[incompatible-use]
const fetchResult = queryFetcher.getFetchResult();
if (fetchResult != null) {
const snapshot = fetchResult.snapshot ?? null;
const error = fetchResult.error ?? null;

const {requestCacheKey: prevRequestCacheKey} = prevState;
if (prevRequestCacheKey != null) {
delete requestCache[prevRequestCacheKey];
}

newState.renderProps = getRenderProps(
error,
snapshot,
// $FlowFixMe[incompatible-call]
queryFetcher,
prevState.retryCallbacks,
);
newState.snapshot = snapshot;
newState.requestCacheKey = null;
} else {
// $FlowFixMe[incompatible-use]
queryFetcher.setOnDataChange(this._handleDataChange);
}
} else {
// $FlowFixMe[incompatible-use]
queryFetcher.setOnDataChange(this._handleDataChange);
}
// $FlowFixMe[incompatible-use]
queryFetcher.setOnDataChange(this._handleDataChange);
}
return newState;
});
Expand Down
2 changes: 0 additions & 2 deletions packages/relay-runtime/util/RelayFeatureFlags.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export type FeatureFlags = {
STRING_INTERN_LEVEL: number,
USE_REACT_CACHE: boolean,
USE_REACT_CACHE_LEGACY_TIMEOUTS: boolean,
ENABLE_QUERY_RENDERER_SET_STATE_PREVENTION: boolean,
LOG_MISSING_RECORDS_IN_PROD: boolean,
ENABLE_RELAY_OPERATION_TRACKER_SUSPENSE: boolean,

Expand Down Expand Up @@ -63,7 +62,6 @@ const RelayFeatureFlags: FeatureFlags = {
STRING_INTERN_LEVEL: 0,
USE_REACT_CACHE: false,
USE_REACT_CACHE_LEGACY_TIMEOUTS: true,
ENABLE_QUERY_RENDERER_SET_STATE_PREVENTION: false,
LOG_MISSING_RECORDS_IN_PROD: false,
ENABLE_LOOSE_SUBSCRIPTION_ATTRIBUTION: false,
ENABLE_OPERATION_TRACKER_OPTIMISTIC_UPDATES: false,
Expand Down

0 comments on commit 5c069d7

Please sign in to comment.