File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ import * as Notifications from "../../elements/notifications";
1515
1616let bannerShownThisSession = false ;
1717
18+ export let lastSeenServerCompatibility : number | undefined ;
19+
1820function timeoutSignal ( ms : number ) : AbortSignal {
1921 const ctrl = new AbortController ( ) ;
2022 setTimeout ( ( ) => ctrl . abort ( new Error ( "request timed out" ) ) , ms ) ;
@@ -52,6 +54,11 @@ function buildApi(timeout: number): (args: ApiFetcherArgs) => Promise<{
5254 const compatibilityCheckHeader = response . headers . get (
5355 COMPATIBILITY_CHECK_HEADER
5456 ) ;
57+
58+ if ( compatibilityCheckHeader !== null ) {
59+ lastSeenServerCompatibility = parseInt ( compatibilityCheckHeader ) ;
60+ }
61+
5562 if ( compatibilityCheckHeader !== null && ! bannerShownThisSession ) {
5663 const backendCheck = parseInt ( compatibilityCheckHeader ) ;
5764 if ( backendCheck !== COMPATIBILITY_CHECK ) {
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ import * as SupportPopup from "../modals/support";
77import * as ContactModal from "../modals/contact" ;
88import * as VersionHistoryModal from "../modals/version-history" ;
99import { envConfig } from "../constants/env-config" ;
10+ import { COMPATIBILITY_CHECK } from "@monkeytype/contracts" ;
11+ import { lastSeenServerCompatibility } from "../ape/adapters/ts-rest-adapter" ;
1012
1113document
1214 . querySelector ( "footer #commandLineMobileButton" )
@@ -28,7 +30,17 @@ document
2830 ?. addEventListener ( "click" , ( e ) => {
2931 const event = e as MouseEvent ;
3032 if ( event . shiftKey ) {
31- alert ( envConfig . clientVersion ) ;
33+ alert (
34+ JSON . stringify (
35+ {
36+ clientVersion : envConfig . clientVersion ,
37+ clientCompatibility : COMPATIBILITY_CHECK ,
38+ lastSeenServerCompatibility,
39+ } ,
40+ null ,
41+ 2
42+ )
43+ ) ;
3244 } else {
3345 VersionHistoryModal . show ( ) ;
3446 }
You can’t perform that action at this time.
0 commit comments