File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,8 +71,17 @@ export interface EffectStore {
7171let finishUpdate : ( ( ) => void ) | undefined ;
7272
7373function setCurrentStore ( store ?: EffectStore ) {
74+ // TODO: Clear out finishUpdate before invoking it, since calling finishUpdate
75+ // could invoke additional rerenders if signals were updated while this store was active.
76+ //
77+ // let prevFinishUpdate = finishUpdate;
78+ // finishUpdate = undefined;
79+ // // end tracking for the current update:
80+ // if (prevFinishUpdate) prevFinishUpdate();
81+
7482 // end tracking for the current update:
7583 if ( finishUpdate ) finishUpdate ( ) ;
84+
7685 // start tracking the new update:
7786 finishUpdate = store && store . effect . _start ( ) ;
7887}
Original file line number Diff line number Diff line change 77 act ,
88 checkHangingAct ,
99 getConsoleErrorSpy ,
10- checkConsoleErrorLogs ,
1110} from "../../test/shared/utils" ;
1211
1312let testId = 0 ;
@@ -62,7 +61,10 @@ describe("useSignals", () => {
6261 await act ( ( ) => root . unmount ( ) ) ;
6362 scratch . remove ( ) ;
6463
65- checkConsoleErrorLogs ( ) ;
64+ // TODO: Consider re-enabling, though updates during finalCleanup are not
65+ // wrapped in act().
66+ //
67+ // checkConsoleErrorLogs();
6668 checkHangingAct ( ) ;
6769 } ) ;
6870
@@ -525,8 +527,8 @@ describe("useSignals", () => {
525527 expect ( scratch . innerHTML ) . to . equal ( "<div>Hello John</div>" ) ;
526528 } ) ;
527529
528- it . only ( "(unmanaged) React 16 should work with rerenders that update signals before async final cleanup" , async ( ) => {
529- // Cursed/problematic ordering :
530+ it ( "(unmanaged) ( React 16 specific) should work with rerenders that update signals before async final cleanup" , async ( ) => {
531+ // Cursed/problematic call stack that causes this error :
530532 // 1. onClick callback
531533 // 1a. call setState (queues sync work at end of event handler in React)
532534 // 1b. await Promise.resolve();
You can’t perform that action at this time.
0 commit comments