mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fixed an edge case profiling bug where the number of commits was wrong
This commit is contained in:
+14
-13
@@ -410,24 +410,19 @@ export default class Store extends EventEmitter {
|
||||
startProfiling(): void {
|
||||
this._bridge.send('startProfiling');
|
||||
|
||||
// Invalidate suspense cache if profiling data is being (re-)recorded.
|
||||
// Note that we clear now because any existing data is "stale".
|
||||
this._profilingCache.invalidate();
|
||||
|
||||
this._isProfiling = false;
|
||||
this.emit('isProfiling');
|
||||
// Don't actually update the local profiling boolean yet!
|
||||
// Wait for onProfilingStatus() to confirm the status has changed.
|
||||
// This ensures the frontend and backend are in sync wrt which commits were profiled.
|
||||
// We do this to avoid mismatches on e.g. CommitTreeBuilder that would cause errors.
|
||||
}
|
||||
|
||||
stopProfiling(): void {
|
||||
this._bridge.send('stopProfiling');
|
||||
|
||||
// Invalidate suspense cache if profiling data is being (re-)recorded.
|
||||
// Note that we clear again, in case any views read from the cache while profiling.
|
||||
// (That would have resolved a now-stale value without any profiling data.)
|
||||
this._profilingCache.invalidate();
|
||||
|
||||
this._isProfiling = false;
|
||||
this.emit('isProfiling');
|
||||
// Don't actually update the local profiling boolean yet!
|
||||
// Wait for onProfilingStatus() to confirm the status has changed.
|
||||
// This ensures the frontend and backend are in sync wrt which commits were profiled.
|
||||
// We do this to avoid mismatches on e.g. CommitTreeBuilder that would cause errors.
|
||||
}
|
||||
|
||||
toggleIsCollapsed(id: number, isCollapsed: boolean): void {
|
||||
@@ -812,6 +807,12 @@ export default class Store extends EventEmitter {
|
||||
|
||||
if (this._isProfiling !== isProfiling) {
|
||||
this._isProfiling = isProfiling;
|
||||
|
||||
// Invalidate suspense cache if profiling data is being (re-)recorded.
|
||||
// Note that we clear again, in case any views read from the cache while profiling.
|
||||
// (That would have resolved a now-stale value without any profiling data.)
|
||||
this._profilingCache.invalidate();
|
||||
|
||||
this.emit('isProfiling');
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user