File tree 2 files changed +11
-5
lines changed
2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -1112,8 +1112,12 @@ describe("router.revalidate", () => {
1112
1112
revalidation : "idle" ,
1113
1113
loaderData : { root : "ROOT**" } ,
1114
1114
} ) ;
1115
+ // The interrupted revalidation hooks into the next completed navigation
1116
+ // so it reflects the end state value
1115
1117
expect ( revalidationValue ) . toBe ( "ROOT**" ) ;
1116
- expect ( navigationValue ) . toBe ( "ROOT**" ) ;
1118
+ // The interim navigation gets interrupted and ends while the router still
1119
+ // reflects the original value
1120
+ expect ( navigationValue ) . toBe ( "ROOT" ) ;
1117
1121
expect ( navigationValue2 ) . toBe ( "ROOT**" ) ;
1118
1122
1119
1123
// no-op
@@ -1126,7 +1130,7 @@ describe("router.revalidate", () => {
1126
1130
loaderData : { root : "ROOT**" } ,
1127
1131
} ) ;
1128
1132
expect ( revalidationValue ) . toBe ( "ROOT**" ) ;
1129
- expect ( navigationValue ) . toBe ( "ROOT** " ) ;
1133
+ expect ( navigationValue ) . toBe ( "ROOT" ) ;
1130
1134
expect ( navigationValue2 ) . toBe ( "ROOT**" ) ;
1131
1135
} ) ;
1132
1136
} ) ;
Original file line number Diff line number Diff line change @@ -2864,10 +2864,12 @@ export function createRouter(init: RouterInit): Router {
2864
2864
return dataResults ;
2865
2865
}
2866
2866
2867
+ if ( request . signal . aborted ) {
2868
+ return dataResults ;
2869
+ }
2870
+
2867
2871
for ( let [ routeId , result ] of Object . entries ( results ) ) {
2868
- if ( ! result ) {
2869
- dataResults [ routeId ] = { type : ResultType . error , error : result } ;
2870
- } else if ( isRedirectDataStrategyResult ( result ) ) {
2872
+ if ( isRedirectDataStrategyResult ( result ) ) {
2871
2873
let response = result . result as Response ;
2872
2874
dataResults [ routeId ] = {
2873
2875
type : ResultType . redirect ,
You can’t perform that action at this time.
0 commit comments